Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - [WIP] Wizard Platformer

Reply to topic Goto page Previous  1, 2
Author Message
  • Joined: 04 Jul 2010
  • Posts: 542
  • Location: Angers, France
Reply with quote
Post Posted: Wed Nov 29, 2023 7:45 pm
Lovely level.
Nice use of priority on tiles.
  View user's profile Send private message
  • Joined: 28 Sep 2023
  • Posts: 9
  • Location: Castelló, Spain
Reply with quote
Post Posted: Thu Nov 30, 2023 2:13 pm
badcomputer wrote
Thanks guys!

Work continues. I've integrated the forest tileset into stage loading and it's opened up a few more "todo" items, but I've been able to test it.


It amazes me how gorgeous the forest looks, it would be easy to think that it is 16 bits. Your work just demonstrates how important good color management is when creating a game for old (but loved) platforms
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 3828
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Thu Nov 30, 2023 4:13 pm
ichigobankai wrote
Lovely level.
Nice use of priority on tiles.


OK, ichigo said it already :D
  View user's profile Send private message Visit poster's website
  • Joined: 19 Oct 2023
  • Posts: 138
Reply with quote
Post Posted: Fri Dec 01, 2023 12:42 pm
Thanks everyone.

Progress today, we now have stage transitions and palette fading. Next I'll start doing some combat-related stuff.

  View user's profile Send private message Visit poster's website
  • Joined: 09 Jun 2014
  • Posts: 378
Reply with quote
Post Posted: Fri Dec 01, 2023 3:47 pm
That is a very smooth fade!
  View user's profile Send private message Visit poster's website
  • Joined: 04 Jul 2010
  • Posts: 542
  • Location: Angers, France
Reply with quote
Post Posted: Fri Dec 01, 2023 4:37 pm
Very nice.
Why do you have red dots under the hud when fading ?
  View user's profile Send private message
  • Joined: 19 Oct 2023
  • Posts: 138
Reply with quote
Post Posted: Fri Dec 01, 2023 5:57 pm
ichigobankai wrote
Very nice.
Why do you have red dots under the hud when fading ?


This was an unoptimised version reloading the screen in a single frame, I think that caused the distortion. I've since spread it out over a few more frames and got rid of them.
  View user's profile Send private message Visit poster's website
  • Joined: 19 Oct 2023
  • Posts: 138
Reply with quote
Post Posted: Fri Dec 01, 2023 9:36 pm
Worked a little more on the cave tileset and testing on CRT. There seems to be a lot of opportunity for tile flipping on this tileset so I'll probably get a good variety from a lot less tiles.

  View user's profile Send private message Visit poster's website
  • Joined: 04 Jul 2010
  • Posts: 542
  • Location: Angers, France
Reply with quote
Post Posted: Fri Dec 01, 2023 10:02 pm
image is so clean that is looks like to the HLSL shader on Mame ^^
  View user's profile Send private message
  • Joined: 19 Oct 2023
  • Posts: 138
Reply with quote
Post Posted: Fri Dec 01, 2023 10:35 pm
ichigobankai wrote
image is so clean that is looks like to the HLSL shader on Mame ^^


Yes I meant CRT filter, in this case ShaderGlass.
  View user's profile Send private message Visit poster's website
  • Joined: 19 Oct 2023
  • Posts: 138
Reply with quote
Post Posted: Sat Dec 02, 2023 3:31 pm
Spent too long trying to opimtise my tile column loading routine. It's not too slow and I have several enemies, sounds and music playing, but I wonder if it will cause issues later on.

I'm loading a new column on a single frame when I need it and using the below in a loop over my meta tile map (and grabbing the two tiles I need within each meta tile):

SMS_setNextTileatXY
SMS_setTile

I tried loading the column using SMS_loadTileMapColumn but saw very little difference. I could try preloading a column on the left and right of the screen over several frames but my head hurts just thinking how to get it to time correctly.

There's no easy way to get the tiles from a meta tile as each stores 4 tiles in row-column order.

On reflection I should've stored the meta tile map in column first order, and the tiles within a meta tile in column first order. However, I don't feel like re-writing my meta tilemap code just yet. I also question how much I would gain from it.
  View user's profile Send private message Visit poster's website
  • Joined: 04 Jul 2010
  • Posts: 542
  • Location: Angers, France
Reply with quote
Post Posted: Sat Dec 02, 2023 4:48 pm
you'll have nice gain in retrieving data, for sure, as they are already prepared in good order (so read datas and "only" have to push them in the VDP).
But you'll not have many gain in VDP writes as it's better in sequential (row) order.

Maybe you can also compress slices, depend on level design (like give ID to each column slice, generate a LUT, if there's redundant parts)
  View user's profile Send private message
  • Joined: 28 Jan 2017
  • Posts: 556
  • Location: Málaga, Spain
Reply with quote
Post Posted: Sat Dec 02, 2023 5:43 pm
Sorry... was planning to open a new thread with a question....

But.... now that I am here.... good work, like it!!!!
  View user's profile Send private message
  • Joined: 19 Oct 2023
  • Posts: 138
Reply with quote
Post Posted: Sat Dec 02, 2023 5:55 pm
eruiz00 wrote
Sorry... was planning to open a new thread with a question....

But.... now that I am here.... good work, like it!!!!


Haha that's OK!

ichigobankai I like your idea about a LUT, it should at least speed up access to the data.

Perhaps it's a bit of premature optimisation or expecting too much from a 30 year old console. The CPU levels on Emulicious I'm getting compare well to commercial games, I get at most 70% on spikes during scrolling and 40% steady during non-scrolling gameplay, which is similar to Castle of Illusion, but I wonder how accurate that is?
  View user's profile Send private message Visit poster's website
  • Joined: 28 Jan 2017
  • Posts: 556
  • Location: Málaga, Spain
Reply with quote
Post Posted: Sat Dec 02, 2023 6:15 pm
I have not seen your column filling routine, but what I have to say is that all my games (all of them, except minimsx and baluba balok)have a pure ansi c engine for scrolling and I am more than satisfied with the sdcc optimizations (more that with my own code).

Other thing is that, if you enter in complex game logics (to manage enemies, shoots, player shoots, collisions of all of the elements with map, animations, etc.) I think you will be forced (if do not jump to assembler) to adopt a two frames routine (two screen frames per game frame logic) which is not bad with ntsc timings.

Regards.
  View user's profile Send private message
  • Joined: 19 Oct 2023
  • Posts: 138
Reply with quote
Post Posted: Sat Dec 02, 2023 7:08 pm
eruiz00 wrote

Other thing is that, if you enter in complex game logics (to manage enemies, shoots, player shoots, collisions of all of the elements with map, animations, etc.) I think you will be forced (if do not jump to assembler) to adopt a two frames routine (two screen frames per game frame logic) which is not bad with ntsc timings.


Ah that's interesting. Do you mean for example do player updates in one frame and enemies etc in the next one?
  View user's profile Send private message Visit poster's website
  • Joined: 28 Jan 2017
  • Posts: 556
  • Location: Málaga, Spain
Reply with quote
Post Posted: Sat Dec 02, 2023 7:30 pm
I explain... I have the game logic like it were a single screen loop.... by example (this is the electronic dreams pattern):

while(true)
{
  while (!VDPBlank);
  SMS_waitForVBlank();
  VDPBlank=0;

  UpdateSprites()  // This is the finalize-load to sat-initialize sprites task,
  which should be after the waitforvblank task if you use the unsafe
  smslib version...

  UpdateScrollCols()

  ...
  UpdateInput()
  UpdatePlayer()
  UpdateEnemies()
  UpdateWhateverYouWant()
  ...

}


The key is this:

  while (!VDPBlank);
  SMS_waitForVBlank();
  VDPBlank=0;

It will wait for two retraces if the last frame took less than one frame, and will wait for one retrace only, if the last frame took more than that one frame.

VDPBlank is a SMSLib variable, which (I think) it is not exposed (but you can declare it as extern)

Of course you can put a custom frame handler to have a screen loop based function, but this will lead you to a big headache (the interrupt troubles I am having this month with the new project, which is a game about a witch which walks in a forest, a castle, a cavern.... killing ghosts and other enemies.... :D).

But, with the double frame technique you can maintain a constant game speed, even taking more than a frame to process all the elements in the game.

Other important thing (for me) is that you do not have to calculate all the collisions between elements (by example, enemies with player) on every frame, every two-four frames is enough.

This is the way I found to make the things, fighting against the hardware limitations (and my own limitations) since 2017.
  View user's profile Send private message
  • Joined: 04 Jul 2010
  • Posts: 542
  • Location: Angers, France
Reply with quote
Post Posted: Sat Dec 02, 2023 11:12 pm
really depends on game engine needs and how it is coded.

On shmups, with some high speed elements (bullets), you must check every frame otherwise you'll certainly miss some collision (you can divide the screen into zone, and quickly check if there is some bullets/sprites of different types in)

on plateformers or brawlers, you can quickly check elements based on Y axis. Data struct have also some keys, if you put the Y value in 1st place, you can check pretty quickly elements.

as animation are the same for few frames (generally around 4) between updates, on free frame, you can update other animations or ia. Like frame 0= upd player, frame 1=ennemies 1-2, frame 2=ennemies 3-4, frame 3=background anims.

if your game engine is spread on more than 1 frame, your fps will drop accordingly ; 1 frame = 60fps, 2 frames = 30 fps, and so on (for a 60hz system). See Street Fighter 2, Golden Axe or Mortal Kombat for example, with heavy complex code for multiplexing sprites and background tiles on the fly ; Games runs at ~10fps... not very cool.
30fps is possible ; WB3 is "only" 30fps, and what game!

Obviously there is -unfortunately- a real gap between C and ASM on those old systems (at least for the moment, but maybe in a distant time, C compilers will produce code like written by hand)
  View user's profile Send private message
  • Joined: 26 Aug 2022
  • Posts: 21
Reply with quote
Post Posted: Sat Dec 02, 2023 11:54 pm
Honestly I don't think dropping down to 30fps is good advice, unless you're going for way more than can be done in a single frame (see Wonder Boy III)

IMO optimizing in ASM and, if needed, cutting down elements is the way to go.
  View user's profile Send private message
  • Joined: 19 Oct 2023
  • Posts: 138
Reply with quote
Post Posted: Sun Dec 03, 2023 9:04 am
Thanks guys. This high level information is very useful, especially for a newbie like me. I'd love to see more stuff like this and the devkit pinned to this forum.

In terms my game, I think I will keep my single loop for now and cut down elements and update frequencies where I can and then see where we are.
  View user's profile Send private message Visit poster's website
  • Joined: 19 Oct 2023
  • Posts: 138
Reply with quote
Post Posted: Sun Dec 03, 2023 11:28 am
What's the correct way to stream sprite tiles?

There are a few functions for loading and decompressing tiles I'm not sure which I should be using.

All I need for the player at the moment is two 8x16 sprites, so I need to load 4 tiles into VRAM whenever my player animation changes.

I currently have my player sprite tiles in ROM compressed with ZX7. Do I need to decompress these before I use SMS_loadTiles?

I've tried using the above but it's loads in a garbled mess.

I couldn't find any examples of tile streaming with devkit either, hence my question here.
  View user's profile Send private message Visit poster's website
  • Joined: 04 Jul 2010
  • Posts: 542
  • Location: Angers, France
Reply with quote
Post Posted: Sun Dec 03, 2023 11:45 am
If you want to stream tiles, better to use uncompressed binaries. Zx7 things are very slow to uncompress.
+ You can't have offset in the compressed tiles (so how will you find next frame anim)
Zx7 is perfect for long run of background tiles or ennemies sprite sheats, loaded before the level
  View user's profile Send private message
  • Joined: 19 Oct 2023
  • Posts: 138
Reply with quote
Post Posted: Sun Dec 03, 2023 1:36 pm
ichigobankai wrote
If you want to stream tiles, better to use uncompressed binaries. Zx7 things are very slow to uncompress.
+ You can't have offset in the compressed tiles (so how will you find next frame anim)
Zx7 is perfect for long run of background tiles or ennemies sprite sheats, loaded before the level


Thanks!
  View user's profile Send private message Visit poster's website
  • Joined: 28 Jan 2017
  • Posts: 556
  • Location: Málaga, Spain
Reply with quote
Post Posted: Sun Dec 03, 2023 6:47 pm
ummmm....

I would not load the player animation tiles each frame if I can avoid such waste of time.

I explain... If you want to keep the things simple, load all the player animation tiles at once. By example, in silver valley I used about 80 tiles for all the player required sprites, and the rest for the enemies.

If you game requires more than 256 tiles in a scene (because you have several different monsters and all of them, with the player tiles, overcome such number) I would think in load the player sprites each time they change.

... but If you want to avoid the 30fps I would save as much processing time as I could (you must be near of the limit, trust me)...
  View user's profile Send private message
  • Joined: 19 Oct 2023
  • Posts: 138
Reply with quote
Post Posted: Sun Dec 03, 2023 7:13 pm
Yea I'm only loading new player tiles when the animation changes, that's a minimum of every 3-6 frames.

I'm using the second half of the tiles for sprites so only have 192 tiles and I plan to have a few nice big enemy sprites on each stage, so streaming the player tiles will help a lot.
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 3828
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Mon Dec 04, 2023 10:57 am
badcomputer wrote
I tried loading the column using SMS_loadTileMapColumn but saw very little difference.


SMS_loadTileMapColumn basically cuts the overhead, as it knows in advance that you want to write 2 bytes to VRAM each time in a loop where all writes starts 64 bytes apart. If most of your time is spent preparing the data you need to update, you won't have a big improvement overall. The way you organize your source data will likely dictate at what speed you'll be able to access it.
  View user's profile Send private message Visit poster's website
  • Joined: 19 Oct 2023
  • Posts: 138
Reply with quote
Post Posted: Mon Dec 04, 2023 10:51 pm
sverx wrote
The way you organize your source data will likely dictate at what speed you'll be able to access it.


For sure, although I'm going to see if it will be fast enough before I refactor it.

Today I worked on the spell effects. Here's the earth spell which allows you to create a temporary platform, although perhaps the final version won't be this unlimited.

  View user's profile Send private message Visit poster's website
  • Joined: 15 Aug 2019
  • Posts: 262
  • Location: Lancashire UK
Reply with quote
Post Posted: Fri Dec 08, 2023 4:13 pm
Do we have a demo for this one yet pls?
  View user's profile Send private message Visit poster's website
  • Joined: 19 Oct 2023
  • Posts: 138
Reply with quote
Post Posted: Fri Dec 08, 2023 6:56 pm
8BitBoy wrote
Do we have a demo for this one yet pls?


We do not. Steady progress is being made though.
  View user's profile Send private message Visit poster's website
  • Joined: 19 Oct 2023
  • Posts: 138
Reply with quote
Post Posted: Sat Feb 10, 2024 10:08 pm
I posted over on twitter but to provide an update here too.

I'm restarting the design of this wizard game. It became too big to manage for now and I was also feeling it becoming quite derivative.

The plan is to cut some platformer/adventure features and lean more into the puzzle side, rather than trying to do both.

Thankfully I can keep all the assets I've made so far.

A future update on this might be a while now as I have another smaller game I'm revisiting so I think I'll be focussing on that next.
  View user's profile Send private message Visit poster's website
  • Joined: 01 Feb 2014
  • Posts: 878
Reply with quote
Post Posted: Sun Feb 11, 2024 8:25 am
Sounds like a wise decision. Focusing on a smaller project and polishing it to perfection is always preferable to tackling something over-ambitious you can’t really give the necessary attention to detail to.

Still looking forward to what you will come up with. Blast Arena was a stunning debut, and I really like your art for the wizard game.
  View user's profile Send private message
  • Joined: 19 Oct 2023
  • Posts: 138
Reply with quote
Post Posted: Mon Feb 12, 2024 7:47 pm
Kagesan wrote
Sounds like a wise decision. Focusing on a smaller project and polishing it to perfection is always preferable to tackling something over-ambitious you can’t really give the necessary attention to detail to.

Still looking forward to what you will come up with. Blast Arena was a stunning debut, and I really like your art for the wizard game.


Thanks Kagesan.
  View user's profile Send private message Visit poster's website
Reply to topic Goto page Previous  1, 2



Back to the top of this page

Back to SMS Power!