[community project] RPG

Advice on general approaches or feasibility and discussions about game design

Re: [community project] RPG

Postby deeph » Mon Mar 28, 2016 7:52 pm

Maybe we should get at least one fully working map (player movements/scroll/etc...) before, no ? Have you been able to run anything ?
deeph
 
Posts: 52
Joined: Mon Jul 13, 2015 6:09 am
Location: France

Re: [community project] RPG

Postby Sorunome » Mon Mar 28, 2016 7:54 pm

I think I may have just ninja-edited you, i kinda need a test map for colission detection, player animation, sprite animation and the camera moving along with the player is working. The player is masked.

EDIT: Oh, also, how is your stuff set out now with animated tiles? As in, how are sprites stored etc.?
User avatar
Sorunome
 
Posts: 629
Joined: Sun Mar 01, 2015 1:58 pm

Re: [community project] RPG

Postby deeph » Tue Mar 29, 2016 4:33 am

Ok, I'll try your code as soon as possible.

Sorunome wrote:EDIT: Oh, also, how is your stuff set out now with animated tiles? As in, how are sprites stored etc.?

Tiles are currently simply stored together, walkables ones first and then the non-walkable ones. A constant make the limit, as for animated tiles.

Maybe we should make the map editor using Python ? This way we could both easily create maps with events etc... I would ease a lot of things. I've not programmed much with it yet, but looks like there are GUI, so it shouldn't be too hard.
deeph
 
Posts: 52
Joined: Mon Jul 13, 2015 6:09 am
Location: France

Re: [community project] RPG

Postby rodot » Tue Mar 29, 2016 6:04 am

User avatar
rodot
Site Admin
 
Posts: 1290
Joined: Mon Nov 19, 2012 11:54 pm
Location: France

Re: [community project] RPG

Postby Sorunome » Tue Mar 29, 2016 11:31 am

So, for dynamic sprite loading....I think it would be a good idea as that allows us to use a great number of different sprites!
I kind of like the idea of how you have animated sprites at the end resulting in non-animated ones using fewer data. Am I seing it correctly that the animated sprites are two-frames?
Anyhow, here is what I propose: a 256-byte buffer for the currently displayed sprites for the tilemap (that is excluding player, enemies and stuff). 256 as in 32*8, maybe we could shrink it if it is too large, anyhow, here's what I'm thinking:
While loading the tilemap from the SD card fetch the sprite data from the card, too, only the one needed for this tilemap.
For great diversity I'd say we go beyond 256 different sprites, those fill up quickly and mainly only take space on the SD card anyways, which is next to unlimited for us. So two-byte identifiers for the sprite, that's 65536 different sprites which is more than enough!
Anyhow, here is what I picture the process like currently:
Load the entire 12*8*2 tilemap into RAM (192 bytes) (probably the screen buffer as that isn't used during screen transitions). Fill out (0xFFFF's) another 64 byte buffer, i'll call that used ID's for now.
Now loop through the temp-tilemap buffer, two bytes at a time as a sprite ID is two bytes in this proposed thing. For each encountered ID i'd check if it exists in the used-id-buffer, if it is, take the two-byte offset thingy and put it into the real tilemap buffer as that is the new sprite ID then, if it isn't do one of the following things:
Non-animated tile: loop through the used-id-buffer from the front, until the first blank space, write it's ID in and copy the sprite data into the 256-byte sprite buffer from the appropriate slot
Animated tile: loop through the used-id-buffer from the back, take up two slots (as animated tiles are two-frames, the second one could be marked with 0xFFFE) and write both of it's sprites to the 256-byte sprite buffer. Next adjust a one-byte variable for the marker where the animated tiles start.

If a tile is passable could be stored in a seperate 32-byte buffer, also allowing for an easy implemention of that 4x4 pixel grid for passable stuff, and animated tiles being walkable!

After this process the used-id-buffer and temp-tilemap buffer aren't needed anymore, thus me thinking of putting that into the screen buffer.

This way we could have up to 32 non-animated sprites or 16 animated sprites, depending on the need (and ofc anything in between, as long as the 32*8 bytes allow it). Or do you think that is overkill-too-much? Any other suggestions/ideas/maybe you don't like this?

EDIT: Oh, also, I reverted in that commit to my camera movement thing because I couldn't figure out your logic to keep the camera in bounds, feel free to apply your logics, though, as they looked more optimized, heehee

EDIT2: On an unrelated note, I updated GB_Fat to save two dynamically allocated bytes when performing a read.
User avatar
Sorunome
 
Posts: 629
Joined: Sun Mar 01, 2015 1:58 pm

Re: [community project] RPG

Postby deeph » Tue Mar 29, 2016 4:23 pm

rodot wrote:How about http://www.mapeditor.org/ ?


I never tried it, though I knew it, but I think it may be more difficult to customize it and to get what we want instead of creating our own.

Sorunome > It looks a bit too complicated to me, I'm not even sure to understand everything. To me, the best solution is to have 12*8 = 96 bytes of tiles data (sprites ID) +1 byte to indicate which tileset we want to load (256 sprites per tileset, or we could do less and shrink the tiles data). The other things (walkable/animated) are much more optimized the way I did, yet it is simplier. And yes, animated tiles are currently 2 frames.
deeph
 
Posts: 52
Joined: Mon Jul 13, 2015 6:09 am
Location: France

Re: [community project] RPG

Postby Sorunome » Tue Mar 29, 2016 4:30 pm

The thing is that I didn't want to have large tilesets in flash as flash wears out when using too many write cycles, and thus I didn't want to reserve another huge flash block for sprite data, thus overgoing that by using 256 bytes of ram. This would also allow for three-bit flags on the tiles for some neat stuff.
Yes, your collision is more optimized, however it does not allow 4x4 pixel collision which would allow for some very neat puzzle/tile/stuff IMO (just play one of those zelda games and notice how often you are actually walking on half a tile rather than a full one) and it would make it way harder for walking on animated tiles as all wall-tiles would have to be animated then, thus taking up more space.

The more simplified version of what I said up there is:
Fetch the map data off of the sd-card and on-the-fly convert the IDs and load the needed sprites into ram while dynamically determining where the animated sprites start and use another lookup thing for the data which sprite ID is walkable in which way.
User avatar
Sorunome
 
Posts: 629
Joined: Sun Mar 01, 2015 1:58 pm

Re: [community project] RPG

Postby Sorunome » Fri Apr 01, 2016 5:32 pm

deeph wrote:
rodot wrote:How about http://www.mapeditor.org/ ?


I never tried it, though I knew it, but I think it may be more difficult to customize it and to get what we want instead of creating our own.

[...]

So I just started modifying one that I wrote for another project which runs in the webbrowser. It's hosted on my server, being able to access it you need to make an acc on my website and tell me your username so that I can add the permissions for that!
I already made data creation (as in, sprites, animated sprites, tilemaps and tilemap layouts) working, still need to do a bit of stuff to get exporting to gamebuino-readable files.
User avatar
Sorunome
 
Posts: 629
Joined: Sun Mar 01, 2015 1:58 pm

Re: [community project] RPG

Postby deeph » Fri Apr 01, 2016 6:07 pm

Nice ! :)

But I can't register : "<br /> <b>Fatal error</b>: Cannot access private property Security::$newestPwdType in <b>/var/www/www.sorunome.de/index.php</b> on line <b>1499</b><br />".

Plus, unfortunately, I don't have that time to code lately and the next week I'll certainly be busy too. But it don't mean that I give up the project ;)
deeph
 
Posts: 52
Joined: Mon Jul 13, 2015 6:09 am
Location: France

Re: [community project] RPG

Postby Sorunome » Fri Apr 01, 2016 6:48 pm

deeph wrote:Nice ! :)

But I can't register : "<br /> <b>Fatal error</b>: Cannot access private property Security::$newestPwdType in <b>/var/www/www.sorunome.de/index.php</b> on line <b>1499</b><br />".

Plus, unfortunately, I don't have that time to code lately and the next week I'll certainly be busy too. But it don't mean that I give up the project ;)

No worries, i'm working on good map loading right now anyways. Also the register bug should be fixed now ;)
User avatar
Sorunome
 
Posts: 629
Joined: Sun Mar 01, 2015 1:58 pm

PreviousNext

Return to Project Guidance & Game development

Who is online

Users browsing this forum: No registered users and 16 guests

cron