Author Topic: Virtua Skimmer  (Read 1224 times)

SkimmingSanshiro

  • Newbie
  • *
  • Posts: 21
  • Karma: +3/-0
    • View Profile
Virtua Skimmer
« on: April 25, 2018, 03:04:19 pm »
Heres my project i've been working on. Its a Tony Hawk style Skimboard game, you do whats called a "wrap" on a wave and do as many tricks as possible without falling 


Its still a work in progress but I reached the dynamic memory usage limit and probably be awhile before I can do a significant update since i'm still learning basics. Recommended emulator is Yabause as SSF is too fast. On Saturn hardware everything is a bit to fast(the wave especially) but probably more the speed im looking for finished. The water dithered mesh that moves rapidly im going to replace with a Grandia water style raster effect as the current jerking motion is almost flashing colors at you.

Issues-
runs about %50 to fast on sff %40 to slow in Yabause compared to hardware(Overall speed in general not finished)
Out of dynamic memory for more transformations
Printf tricks dont clear when finish run
Gameplay is about %30 (No real collision/Hacky Gravity + Controls)

To Do-
Move mesh/Textures off main ram to free up dynamic memory
Grandia Style Water effect(VDP2 Raster effect?https://youtu.be/Foln_F9ggk8?t=1m46s)
Link system (Tricks must be done quickly together or lose link)
Animation
Convert title screen meshes to hardcoded images
Collision/Physics
2 Player
Fishing mode using saturn mouse

https://github.com/VirtuaSkimmer/Virtua-Skimmer-Sega-Saturn-
https://www.youtube.com/watch?v=yqetF9Q5tG0

XL2

  • Sr. Member
  • ****
  • Posts: 341
  • Karma: +72/-1
    • View Profile
Re: Virtua Skimmer
« Reply #1 on: April 26, 2018, 01:58:09 am »
 Good job!
I'll try to give you a hand if I can find some free time.

Using the tool I made you should fix all your memory issues.
You probably allocate memory for sprites but don't clear it.
Also make sure your sprites are loaded from the disk, not hardcoded.

For the framerate, when you use "slSynch ()", it will wait unitl the end of the allocated time before rendering again, so it shouldn't be too fast nor too slow depending on your settings. The jo core run also calls slSynch at the end of each loop.
You can try different settings (like your speed increases x units * nb of frames).
Make sure your emulator also has its frame limiter option on.

For the vdp2 effect you want, it involves using line scrolling.
I never tried it yet myself, but I think there is one SGL demo using it.

For collisions, you can simply use a bounding box or sphere and use the quads' normals to calculate where it should push you.

You will need a basic spatial subdivision for that (a grid is the easiest choice and what I would suggest you to try).

XL2

  • Sr. Member
  • ****
  • Posts: 341
  • Karma: +72/-1
    • View Profile
Re: Virtua Skimmer
« Reply #2 on: May 14, 2018, 04:16:10 am »
Just to help you a bit with your project.

I made a model converter and binary loader, so you can use it to load your player and other entities.
It allows you to load multiple models and display them easily.
It should fix your memory issues if you use the binary files (ZTP).
It doesn't read the texture coordinates, so you need to either flip your quads yourself or flip the textures (a bit of a pain, but that's how the Saturn works sadly, with no texture coordinates).

For flat shaded quads, use a 8x1 texture, as my converter doesn't read the MTL file. I plan to transform these 8x1 textures to normal polygons (untextured) at a later time.
Make sure your images have no more than 16 colors and are saved as 32 bits TGA images (no RLE compression).

I might switch to FBX to allow animations and I'd like to add realtime gouraud shading someday, so for now it's just simple and dumb lightning, but anyway enjoy!

NB : The model converter is in the TOOL subfolder. The ZTI image converter is also there.

« Last Edit: May 14, 2018, 04:19:56 am by XL2 »

XL2

  • Sr. Member
  • ****
  • Posts: 341
  • Karma: +72/-1
    • View Profile
Re: Virtua Skimmer
« Reply #3 on: May 14, 2018, 11:30:21 pm »
Ok, small update, I added realtime gouraud shading.

The per-vertex normals might not be 100% right, so the results might not be as smooth as what you get with the official Sega 3d tool.

Enjoy!

EDIT : I think I got the per-vertex normal OK, see the demo in newer posts.

« Last Edit: May 15, 2018, 02:55:45 am by XL2 »

ponut64

  • Full Member
  • ***
  • Posts: 175
  • Karma: +13/-0
    • View Profile
Re: Virtua Skimmer
« Reply #4 on: May 14, 2018, 11:44:08 pm »
Impressive stuff, XL2. Thanks immensely for sharing.
That takes a 53 KB .h format file down to 16KB.
« Last Edit: May 14, 2018, 11:46:06 pm by ponut64 »

XL2

  • Sr. Member
  • ****
  • Posts: 341
  • Karma: +72/-1
    • View Profile
Re: Virtua Skimmer
« Reply #5 on: May 14, 2018, 11:53:17 pm »
In fact, the .h file takes the same amount of memory (it's in ASCII form, so it takes more memory, but after compiling, it's all binary).
But the most important thing is that it's not hardcoded, so you can load different models for different levels and all.

ponut64

  • Full Member
  • ***
  • Posts: 175
  • Karma: +13/-0
    • View Profile
Re: Virtua Skimmer
« Reply #6 on: May 15, 2018, 12:56:12 am »
That makes sense, not something I have explored enough to understand. When I get that far though a tool like that should be invaluable.
And that explains why you'd need a function to draw the polygon since normally the .h files include that.

XL2

  • Sr. Member
  • ****
  • Posts: 341
  • Karma: +72/-1
    • View Profile
Re: Virtua Skimmer
« Reply #7 on: May 15, 2018, 02:54:42 am »
And you also have to consider that the textures aren't included in the h file.

That being said, I just made a small update, I think I got the per-vertex normals right as the whole shading seems smoother now.
I did the update in less than 10 minutes, but it seems to work well.

I also added the vertex normals in the .h file, but I didn't try to see if it works.

I updated both the tool and the demo.


XL2

  • Sr. Member
  • ****
  • Posts: 341
  • Karma: +72/-1
    • View Profile
Re: Virtua Skimmer
« Reply #8 on: May 16, 2018, 04:00:22 am »
I tested it on real hardware, I tried with 7 models (around 180 quads per model) and the results are rather good, with 60 fps with 4 models, then the VDP1 can keep up, but the CPU doesn't. By not updating each frame, it might be possible to keep 60.

https://youtu.be/XapzA2yPEAU
« Last Edit: May 16, 2018, 03:50:57 pm by XL2 »

SkimmingSanshiro

  • Newbie
  • *
  • Posts: 21
  • Karma: +3/-0
    • View Profile
Re: Virtua Skimmer
« Reply #9 on: May 16, 2018, 06:22:43 pm »
Love the gourad lighting and this tool. One thing though when I try adding my working ZTP loading into my project it wont build when I add the void computeLight() and void display_model(entity_t * model, bool UseRealtimeGouraud)

Ive added everything else and successfully builds including the gameloop() and removing Jo engine callbacks and run(). I didn't load the ZTP to the current address or anything in my_draw() yet only exception. But when I add those 2 voids it wont build. I replaced the ZT folder with the new one and the makefiles match

XL2

  • Sr. Member
  • ****
  • Posts: 341
  • Karma: +72/-1
    • View Profile
Re: Virtua Skimmer
« Reply #10 on: May 16, 2018, 06:28:47 pm »
It might work with the Jo Engine callbacks, I'm just not sure because I think it does things with the gouraud shading. Best way to know is to try it.

As for why it doesn't work with your project, I don't know, make sure all the addresses are right.
Also make sure that your are using subfolders and clean up your CD folder as you are limited to the number of files per folder (just remove all those TGA textures, you don't need them anymore).
Remove all the unused header files too to save memory.

If all fails, just do it the other way around : rebuild your game around the demo I gave you.

ponut64

  • Full Member
  • ***
  • Posts: 175
  • Karma: +13/-0
    • View Profile
Re: Virtua Skimmer
« Reply #11 on: May 17, 2018, 05:01:57 pm »
Well, I did get realtime gouraud working, but only with a header file. The important thing is XPDATA, which isn't explained in any of the English documents I have (only PDATA, which obviously does not do real time gouraud). Which requires face normals, which jo engine converter does not make (understandably). That makes your tools necessary, and thank you for that.

I did try to get the binary files working. I can get them to compile no issues, but the model loading routine clearly conflicts with jo engine. (Screen opens to a glitched screen reminiscent of loading the file, then fades to black, then ceases) I'd have to rebuild based on your system routines. Making the Z-Treme engine truly an engine of its own being incompatible with the core of Jo.

I suppose if I wanted to build an extensive project, I (or rather we) really needed those binary load-on-demand files. I'll spend some more time experimenting later on what exactly I will need to put in and take out for it to load properly.

Another thing about your binary files is that they seem to require textures to display. Do you intend on it working with texture-less / material-less models? Not too important, as one could just slap a material on everything and put a white texture on it. Haven't made a conclusion there yet, again, need to do more experiments.

« Last Edit: May 17, 2018, 05:05:26 pm by ponut64 »

XL2

  • Sr. Member
  • ****
  • Posts: 341
  • Karma: +72/-1
    • View Profile
Re: Virtua Skimmer
« Reply #12 on: May 17, 2018, 05:44:17 pm »
For the textures, you can just put a 8x1 single color texture. The tool doesn't read the material data sadly as I never bothered trying to read the mtl files, but it will still convert it as a single color polygon, so it really only takes 4 bytes + 32 bytes for the color data (always 16 unsigned shorts). It was the easiest way to get the tool out in a reasonable amount of time.

The Jo Engine convert does in fact face normals, it's the per vertex normals that it doesn't calculate. I will try to add functions to precalculate lightning for static lights, mainly for the maps. It should help make everything look much better while also being faster than dynamic light. I still need to do some reading on gouraud shading.

For the loading routine, load your Jo Engine specific data first, reinit the CD with my own function, then use the ZT functions.
Binary files are the way to go, but there are restrictions with folders and filenames (max 8 caracters plus 4 for the extension).

Since I wrote so many tools for my game and used many functions differently (like audio), it didn't make much sense to init everything just to reinit almost everything right after, so I'm not using Jo Engine anymore for Sonic Z-Treme, but I will still try to contribute to improve it.

ponut64

  • Full Member
  • ***
  • Posts: 175
  • Karma: +13/-0
    • View Profile
Re: Virtua Skimmer
« Reply #13 on: May 17, 2018, 08:37:13 pm »
I got it working, my friend!

After adding ztCDinit,
I had to (in one stroke so I do not know for sure which one of these was the culprit for the freeze) comment out the text prints and the fade-in / fade-outs as well as the clear screen as well as slScrAutoDisp (in the model loading function).

I have to run now but my model still isn't displaying but Sonic is. I'll get that figured out, just a matter of exporting it all right.

corvusd

  • Jr. Member
  • **
  • Posts: 81
  • Karma: +8/-0
    • View Profile
    • Personal Web Portfolio
Re: Virtua Skimmer
« Reply #14 on: May 17, 2018, 08:57:51 pm »
I tested it on real hardware, I tried with 7 models (around 180 quads per model) and the results are rather good, with 60 fps with 4 models, then the VDP1 can keep up, but the CPU doesn't. By not updating each frame, it might be possible to keep 60.

https://youtu.be/XapzA2yPEAU

Very interesting implementation XL2. You are using one light Dynamic source for all models. 1200 quads lighted whit source. Really nice. You think if is possible improve the performance or use of the CPUs? More Lights and whit color? Thanks! :)
David Gámiz Jiménez

 

Sitemap 1 2 3 4 5 6 7 8 9 10 
SMF spam blocked by CleanTalk