Jump to content
IGNORED

Penult RPG (Atari 2600)


Karl G

Recommended Posts

1 minute ago, Karl G said:

Cool. I won't be able to make the stream, thought. Probably for the best because it's hard for me to avoid giving advice when my games are played, anyway. :P

 

It'll be a fun time today as we poke around every dark corner in the demo and try to level up as far as we can go!

 

- James

Link to comment
Share on other sites

1 hour ago, Thomas Jentzsch said:

During the stream we noticed some problems with the line of sight. Sometimes walls disappear for no reason. 

Thanks! I'll have to find that and investigate.

 

1 hour ago, Thomas Jentzsch said:

Personally I am not sure if the concept works well on such a low res grid where you cannot look very far anyway.

It's about the same visibility distance as the Ultima 3 game that inspired it. It may not be obvious from a glance, but the line of sight code is fairly vital for hiding things in the game like a dungeon on a mountain path, or a city deep in the forest.

 

Anyway, I appreciate you passing this along!

Link to comment
Share on other sites

Just watched the ZPH stream and this game is truly ambitious. The more i was watching the more i like the line-of-sight feature. Never really played many JRPG's however i'm really wanting to sit though and play this. Zelda and Secret of Evermore are my favorites and i know their not the same but this is very impressive, well done ?

Edited by TwentySixHundred
  • Thanks 1
Link to comment
Share on other sites

Re: line of sight, having reviewed some of the video, I'm pretty sure what you are seeing is my line of sight algorithm at work, which does have some limitations based on my limited time to run a line of sight algorithm. Dynamic line of sight like this is common in 2D RPGs and roguelikes. Here's one discussion of some of the more common algorithms in use for this purpose:

 

http://www.adammil.net/blog/v125_Roguelike_Vision_Algorithms.html

 

In the case of my game, I load the current on-screen map tiles into RAM during overscan, and then I need to blank out the non-visible tiles before the visible screen is run to avoid revealing anything hidden from sight.  Currently, I am using raycasting with pre-computed lines from lookup tables, and a fair amount of interpolation due to a limited number of computational cycles to work with. The combination of the method used and the limited number of angles used for raycasting leads to some oddities like not all parts of all walls being visible in a shop from certain positions. Other times, things seeming to disappear out of sight for no reason is due to the presence of "solid" tiles in front that obscure vision. Here's an example of the outside of the town hall in Acadia. The two round tiles are pillars or big trees that are treated as "solid", and block line of sight:

 

penult_10.thumb.png.2b126a546d397ca093fa1117c8bb275f.png

 

If I edit the map to remove these obscuring tiles, it looks like this instead from the same position:

 

penult_11.thumb.png.c16208448a501019f935fe7525f25c69.png

 

Many more tiles are then visible, other than the very corners due to the limitations of my raycasting algorithm described above.

 

I think there are probably still improvements that can be made within the time constraints to help with some of these corner cases (literally!), though.

 

@Thomas Jentzsch or @ZeroPage Homebrew - please let me know if there's anything I didn't notice in the video that maya  have looked like a bug.

Link to comment
Share on other sites

In your example above, I can understand why the tiles behind the right pillar is blocked. And the tile which is one down and one left of the left pillar.

 

But all the other nine blocked tiles seem wrong. I have never played Ultima 3, but IMO the current line of sight implementation is way too rigid and quite irritating.

 

Maybe you could try a more different approach which when in doubt decides not to block.

Edited by Thomas Jentzsch
Link to comment
Share on other sites

I definitely agree that there are tiles that are obscured that shouldn't be with my current approach. Fitting in a workable dynamic vision system within the CPU time constraints was one of my biggest early challenges. There's a bit of code that I can move to a different time slice that should free up a bit more time to improve my current algorithm.

Link to comment
Share on other sites

18 hours ago, Thomas Jentzsch said:

Don't worry too much. No one else has complained yet. Maybe I am just an overly sensitive person. And I am not into Ultima anyway, so... :) 

That kind of feedback is still valuable to me nonetheless. I want the game to be accessible to people who have never seen the Ultima series, too, and not just the subset. of people who are active Atari hobbyists, and are already fans of the series.

 

Seeing how I could improve my vision algorithm with the timing constraints i have should be a fun challenge.

Link to comment
Share on other sites

Maybe you could spread the calculations over multiple frames? With the number of visible tiles increasing from frame to frame?

 

And/or you could do a delta calculation. So when you e.g. move right, you keep the visibility of the old tiles identical to the previous spot and and then re-calculate from right to left. That way the new tiles are always 100% correct and the old, already known tiles get corrected a bit slower.

 

Also, I am not sure, why the calculations require that much time. I haven't implemented this, so maybe I am underestimating the complexity. But given the rather small size of the grid, it seems that visibility could be calculated using tables, no?

Edited by Thomas Jentzsch
  • Like 1
Link to comment
Share on other sites

17 minutes ago, Karl G said:

I like the idea of more tiles becoming visible on a second pass, which would probably be too quick to be noticed, but would be kind of like an image coming into focus, anyway.

I like the idea of old tiles disappearing and only new tiles appearing better. Feels more natural. 

 

But I doubt the difference would be noticeable anyway, if you can fix the errors withing a 2nd frame.

Link to comment
Share on other sites

1 hour ago, Thomas Jentzsch said:

Also, I am not sure, why the calculations require that much time. I haven't implemented this, so maybe I am underestimating the complexity. But given the rather small size of the grid, it seems that visibility could be calculated using tables, no?

It is more complicated than I expected it to be when I first started researching it. A 12-piece 7 grid is 84 tiles, and way too many possible permutations to have in a lookup table. I pre-compute my lines for raycasting in a lookup table to save some processing time, though.

Link to comment
Share on other sites

7 minutes ago, Karl G said:

It is more complicated than I expected it to be when I first started researching it. A 12-piece 7 grid is 84 tiles, and way too many possible permutations to have in a lookup table. I pre-compute my lines for raycasting in a lookup table to save some processing time, though.

Your grid is smaller (10 x 7 = 60) and you only need a table for one quarter (7 x 4 - 1 = 27) of it, no? All other quarters can use the same table, but mirrored. There are still 2^27 permutations though. But maybe this can be cut further down? :ponder:

 

BTW: Is a tile either blocking or not? Or do the different elements block differently?

Edited by Thomas Jentzsch
Link to comment
Share on other sites

44 minutes ago, Thomas Jentzsch said:

BTW: Is a tile either blocking or not? Or do the different elements block differently?

Yes,it is an all or nothing thing, which makes it simpler, at least. Xoxoxo 

 

Edit: it's also not entirely symmetrical, since the hero isn't in the exact center (since he can't be with a width of 12 tiles). 

Link to comment
Share on other sites

17 minutes ago, Karl G said:

Edit: it's also not entirely symmetrical, since the hero isn't in the exact center (since he can't be with a width of 12 tiles). 

Yes, but the left 5 tiles are like the right 5 tiles, no? And the 6 column only exists on the right.

Link to comment
Share on other sites

Good news! I was inspired by the discussion to devise a new visibility algorithm. It eliminates the quirks of the old method, works in one pass, and "only" takes 27 scanlines of vertical blank to complete. The only downside is that it takes more ROM space due to unrolling loops for performance reasons, but I have the space to accept that trade-off.  Here's a few comparative screenshots of the old method vs the new:

 

 

Outdoors Near Mountains

penult_13.thumb.png.bd529fc817db8663bb2c4541eaaf1924.pngpenult_12.thumb.png.5ec40067131de55631877abc704c55f3.png

 

 

In the Weapons Shop

penult_14.thumb.png.ba76be0e399fbe523571246c9ec0d0bf.pngpenult_15.thumb.png.2c0cd9dbf62331f4c34fb50180c1d125.png

 

 

Pillars Outside City Hall

penult_18.thumb.png.862be3418b0d8f0432e5a4be396d87ee.pngpenult_19.thumb.png.13ed98bf41fceac8182c29f60ffa1620.png

 

I'll have to do more testing, but I haven't yet found any cases where the new code reveals something that should be hidden.

 

Many thanks to @Thomas Jentzsch for pointing this out, and the discussion which inspired me to improve on my code.

  • Like 7
Link to comment
Share on other sites

24 minutes ago, Thomas Jentzsch said:

That looks much better. :thumbsup:

 

So what's the trick? :) 

 

In the diagram below, the plus symbols are tiles adjacent to the hero, and are always visible. The ones marked with "1" are straight or diagonal lines that can easily be determined by following the line from the hero, blocking out any tiles that are past any blocking tiles in the path of the line. Once all of those are figured out, the remaining tiles can be figured out through interpolation. Specifically, I check the two adjacent tiles that are closest to the hero, and if either of these is visible and not solid, then the tile in question is also visible. If both of the other tiles are not visible or solid, then it gets blanked out.

 

  0123456789AB
0 XX1XX1XX1XXX
1 XXX1X1X1XXXX
2 XXXX+++XXXXX
3 1111+@+11111
4 XXXX+++XXXXX
5 XXX1X1X1XXXX
6 XX1XX1XX1XXX

So, for example, when checking the tile at (3,4), the two tiles that are adjacent and closest to the hero would be (4,3) and (4,4). If either of those is visible and not solid, then (3,4) remains visible. If both are solid or not visible, then it get blanked out. Tiles need to be checked in the right order from the center out so that it is checking against two "parent" tiles whose visibility is already known.

 

I wrote a C utility to figure out which two "parent" tiles to use for each of these tiles, and to generate the assembly code to check all of them. It was an interesting exercise for sure.

  • Thanks 1
Link to comment
Share on other sites

While some of the things you guys are talking about are a foreign language to me, I do find it interesting how the changes that are made to the game impact on what we see.  I'm enjoying following the development of this title and will soon try out the demo as I recently received my Harmony Encore cart.

 

I will continue to watch this thread and I look forward to future developments and the eventual cart release!  :)

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...