Dingoonity.org

GCW Zero => Development => Topic started by: gameblabla on July 08, 2015, 08:34:12 pm

Title: Cannonball (Outrun engine)
Post by: gameblabla on July 08, 2015, 08:34:12 pm
I have ported Cannonball, a game engine to play Sega's Outrun game !

To play it, extract the outrun roms here (it needs to be extracted, not a zip!) :
/media/home/.cannonball/roms
Then install the opk like any gcw0 games.
(Put the opk in /media/data/apps/)

Controls
A - Accelerate
B - Break
Y - Put coins in
L shoulder - Gear change
R shoulder - Change viewpoint
Start buttion - Start the game
Select button - Menu

Download link (https://github.com/gameblabla/Cannonballs/raw/master/cannonball.opk)
Title: Re: [WIP] Cannonball (Outrun engine)
Post by: opt2not on July 08, 2015, 09:04:27 pm
Thanks for this, I'll check it out when I get home today and report back how it runs on my unit.

i would like to point out though, running Outrun at 60fps was one of the main reasons to go with the Cannonball engine.  Any chance you can add that option back in?

Title: Re: [WIP] Cannonball (Outrun engine)
Post by: gameblabla on July 08, 2015, 09:23:54 pm
Thanks opt2not, can't wait to see how well it runs on the real device !

Quote
i would like to point out though, running Outrun at 60fps was one of the main reasons to go with the Cannonball engine.  Any chance you can add that option back in?
Yes, i will bring back but only if Cannonball is running smoothly on the GCW0.
Title: Re: [WIP] Cannonball (Outrun engine)
Post by: qbertaddict on July 09, 2015, 04:53:52 am
Thanks opt2not, can't wait to see how well it runs on the real device !

Quote
i would like to point out though, running Outrun at 60fps was one of the main reasons to go with the Cannonball engine.  Any chance you can add that option back in?
Yes, i will bring back but only if Cannonball is running smoothly on the GCW0.

I will test it out tomorrow. Would love to see outrun at 60fps.

EDIT: I tested it out. It runs slow but im sure it can be optimized. Right now the sound lags and the controls are sluggish. Its not running at 30fps yet. I'm sure you will figure it out
Title: Re: [WIP] Cannonball (Outrun engine)
Post by: opt2not on July 09, 2015, 07:54:45 am
Got to try it out tonight, and got it working no problem.
Yeah, its running slow for me too.  I think I got a couple frames back from turning the objects to `Original` in the Game Engine->settings, but it still was sub-30 fps for sure.
Music was choppy in both during the game, and in the music test in the Settings Menu.

But hey, not bad for compiling blind. :)

Can I make a request? Could the rom folder be changed to be in /media/home/.cannonball/roms, instead of stranded outside? Keeps that folder more tidy and everything together.  ;)
Title: Re: [WIP] Cannonball (Outrun engine)
Post by: gameblabla on July 09, 2015, 09:14:49 pm
Guys, i have finally found the reason why it was so slow.
I had no idea why it was so slow, even a Raspberry pi can run it at 30 FPS with no issues what so ever....
It turns out, 32 bpp on the GCW Zero is slow.

When i turned the depth to 16, it was much, much faster. It ran at like, 60 FPS.
However, the output was incorrect so the game was unplayable.
Cannonball was designed to work only in 32 bpp so i'll have to modify
the source code in order to have the correct output.

I have no idea how to do that so i'll just ask the author to help me.
Hopefully he's still around... If not, i might ask ptitseb instead.

Can I make a request? Could the rom folder be changed to be in /media/home/.cannonball/roms, instead of stranded outside? Keeps that folder more tidy and everything together.  ;)
I already did that, it will be in my next release.

EDIT:
I have updated Cannonball.
This release should be a little faster : I used some optimisations from ptitseb, and i turned triple buffering on.
This is still not my final release, next release should run smoothly enough.
As requested by opt2not, you should now put your roms in /media/home/.cannonball/roms.
I have reintroduced the ability to change the framerate: fastest is 30 FPS and the slowest is 60 FPS.
Title: Re: [WIP] Cannonball (Outrun engine)
Post by: Xaijiqq on July 10, 2015, 06:07:31 am
i didn't try the previous release but this latest one suffers from severe screen flicker
Title: Re: [WIP] Cannonball (Outrun engine)
Post by: gameblabla on July 10, 2015, 06:29:22 pm
i didn't try the previous release but this latest one suffers from severe screen flicker
Yeah, that's probably due to the triple buffering.
Anyways, i updated it again and turned it off.
Title: Re: Cannonball (Outrun engine)
Post by: gameblabla on October 10, 2016, 12:00:22 am
Hello guys !
The Cannonball team has made some improvements since then and they made an OpenGLES accelerated version that could be used on the GCW0.
So i have decided to make my port from scratch and base it on the latest git version.
As a result, the game now runs smoothly at 30 FPS !

It's still isn't smooth enough at 60 FPS, especially when you start a race, but at least you can enjoy the game.
I dare to say it should run smoothly on Cannonball than on XMAME now.

Do go check it out if you're a fan of Outrun !
Title: Re: Cannonball (Outrun engine)
Post by: Mar8 on October 10, 2016, 04:03:21 am
  You're the man! @gameblabla
Title: Re: Cannonball (Outrun engine)
Post by: howie_k on October 10, 2016, 07:24:16 am
Wow! My fave arcade racer - I have Cannonball on my PC and am stoked you have made it available on GCW Zero - thank you! :)
Title: Re: Cannonball (Outrun engine)
Post by: opt2not on May 24, 2018, 08:00:54 pm
I've been playing this a bunch lately, I really love it.

Is there anyway of configuring the sensitivity of the Analog nub when you enable Analog Steering?
Title: Re: Cannonball (Outrun engine)
Post by: gameblabla on May 25, 2018, 01:01:34 pm
I've been playing this a bunch lately, I really love it.

Is there anyway of configuring the sensitivity of the Analog nub when you enable Analog Steering?
Do you mean the Centre axis or the deadzone ?
Or maybe you mean it steers too fast from right/left ?

Pushed an update that merged changes from upstream and added the possibility to set the centre axis.
Title: Re: Cannonball (Outrun engine)
Post by: opt2not on May 25, 2018, 08:15:51 pm
I've been playing this a bunch lately, I really love it.

Is there anyway of configuring the sensitivity of the Analog nub when you enable Analog Steering?
Do you mean the Centre axis or the deadzone ?
Or maybe you mean it steers too fast from right/left ?

Pushed an update that merged changes from upstream and added the possibility to set the centre axis.
Yeah I think it steers too fast.  It's like it goes to 100% from center to left or right, even when you're only pushing about a quarter of the way to it's restriction point.  I believe the deadzone is fine, it engages when you slightly push on the analog nub, but it ramps up really quickly with just a tiny amount of additional pressure.

I will give this version a try and see if there is any difference in feel.  Thanks for the update!
Title: Re: Cannonball (Outrun engine)
Post by: opt2not on May 27, 2018, 06:27:10 am
Played a bunch of this, and it feels a bit better.  I set the sensitivity setting to 0, but I'm still not able to use a wider analog range before it kicks into full left or right steering.
Title: Re: Cannonball (Outrun engine)
Post by: gameblabla on May 27, 2018, 10:25:24 am
Played a bunch of this, and it feels a bit better.  I set the sensitivity setting to 0, but I'm still not able to use a wider analog range before it kicks into full left or right steering.
Sensitivity to 0 was the default before. If you felt any changes, it's probably because the game now runs at a higher framerate.
Sadly, Outrun is a digital game and it does not properly support analog controls.
It sounds like i may have to change the deadzone to something higher instead.
Title: Re: Cannonball (Outrun engine)
Post by: opt2not on May 27, 2018, 07:58:03 pm
Totally worth a try. This port is so great, and it runs really well on the GCW. I?m surprised this port is digital only, since the original arcade game had analog steering. I?m wondering if this was ported from something like the Sega Saturn version (which also supported running at 60fps).

edit: Actually, I think this is still analog supported, because I can get the small amount of right and left steering if I apply a small amount of pressure to the analog nub. It's just that it goes to 100% very sharply in the analog range.  I mean, don't get me wrong, the game is still very playable and you can adapt to it...it's just having the analog range in line with the physical nub would make the experience a lot better.

reading the wiki, there is this little note about analog steering:
Quote
Analog Controls
Cannonball can also work with analog controllers including racing wheels and pedals.

You can enable analog controls in the Settings -> Controls menu. You should also redefine the gamepad buttons accordingly for start/coin in etc.

There are a few advanced options you might need to edit in the config.xml file. These include which axis the steering and pedals are mapped to. You should be able to check this using the driver software provided with your wheel. It is recommended that each control is mapped to a separate axis in your driver software. However, there is limited split axis support. To enable this, simply configure both the brake and accelerator to be on the same axis.

There is a further zone setting to denote how much of the turning circle of your wheel should be used. Increasing this value from 0 means less of the turning circle of your wheel will be used. This results in tighter steering.


Here's a few pics of my latest runs, based on the last update you uploaded:
(https://i.imgur.com/n6rQdHl.jpg)

(https://i.imgur.com/TnVgAUD.jpg)

(https://i.imgur.com/WONwAp2.jpg)

Title: Re: Cannonball (Outrun engine)
Post by: gameblabla on May 29, 2018, 12:28:08 am
Quote
Analog Controls
Cannonball can also work with analog controllers including racing wheels and pedals.
...
There is a further zone setting to denote how much of the turning circle of your wheel should be used. Increasing this value from 0 means less of the turning circle of your wheel will be used. This results in tighter steering.
I'm very surprised to hear this, i haven't seen any settings like this in the code or ingame.
And as for the axis bit, it has nothing to do with sensibility unfortunately...

I mean, yeah it supports analog controllers but not properly as it should.
I admit i never played cannonball with the analog stick because the stick sucked lel
I'll add settings for the deadzone shortly.

Quote
I?m wondering if this was ported from something like the Sega Saturn version (which also supported running at 60fps).
Nope, it was done from scratch. (and very inefficiently i must add !)
But yeah, the author most probably got the 60FPS patch idea from Saturn version. (which i think also supported a CD soundtrack ?)
Title: Re: Cannonball (Outrun engine)
Post by: opt2not on May 29, 2018, 02:27:49 am
Yeah the Saturn version has a pretty good arrange soundtrack.
As for the gcw nub, I ended up applying some silicone grease to loosen it up. It?s a lot better when the ?travel? is a lot smoother and lighter.

Thanks again for another update, I?ll be sure to test it out when it?s ready and let you know my findings. I?m so glad you?re still supporting the GCW!
Title: Re: [WIP] Cannonball (Outrun engine)
Post by: pcercuei on May 30, 2018, 12:57:19 am
Guys, i have finally found the reason why it was so slow.
I had no idea why it was so slow, even a Raspberry pi can run it at 30 FPS with no issues what so ever....
It turns out, 32 bpp on the GCW Zero is slow.
You're rendering in software, so using 32 bpp means using a framebuffer that's twice as big and you spend twice as much time in the rendering phase.
Title: Re: [WIP] Cannonball (Outrun engine)
Post by: gameblabla on May 30, 2018, 03:10:35 pm
You're rendering in software, so using 32 bpp means using a framebuffer that's twice as big and you spend twice as much time in the rendering phase.
Yeah lol but that's not even the worst part believe it or not.
The way it's rendered, it was doing it pixel-per-pixel. (i kid you not)
Thankfully the new OpenGLES renderer does improve this but it is still very inefficient.
Cannonball is basically using an emulator for rendering graphics.
Title: Re: Cannonball (Outrun engine)
Post by: Bitboy on May 31, 2018, 11:59:36 am
Is there any source code for this so it can be ported to the rs97?
Title: Re: Cannonball (Outrun engine)
Post by: gameblabla on May 31, 2018, 12:19:53 pm
Is there any source code for this so it can be ported to the rs97?
I heard about the RS-97 but don't know much about it... does it also have a Vivante MIPS processor ?
I think it was clocked at 600Mhz.

If you're looking for the source code, it's here :
https://github.com/gameblabla/Cannonballs (https://github.com/gameblabla/Cannonballs)

Makefile for GCW0 :
https://github.com/gameblabla/Cannonballs/blob/master/src/Makefile.gcw0 (https://github.com/gameblabla/Cannonballs/blob/master/src/Makefile.gcw0)

This requires SDL2, Boost libraries and OpenGLESv2 acceleration.
It's possible to use the software renderer instead but don't bother with it, it's ultra slow.
And it being 600Mhz, you can only expect the 30 FPS with GLES to work properly. (don't even think about 60 FPS)
Title: Re: Cannonball (Outrun engine)
Post by: Bitboy on May 31, 2018, 12:22:49 pm
Thank you.

It has a CPU: JZ4760 mips
cpu speed can be pushed to 642mhz no problems.
Screen: 3 inches 320x480

CPU: JZ4760 mips

CPU: JZ4760B mips

528mhz-600mhz

RAM: 128M DDR2

Internal memory: 4GB

Battery: Replaceable BL-5B 890 mAh
We can really do with some devs porting stuff.
By the way thanks for the gcw port i just tried it and it runs great :).
Title: Re: Cannonball (Outrun engine)
Post by: gameblabla on June 02, 2018, 03:11:10 pm
It has a CPU: JZ4760 mips
cpu speed can be pushed to 642mhz no problems.
..
Thanks for the info btw. I looked a bit closer at the RS97's specs and...
it has a Vivante GC200 at its "GPU"...; Well not really a GPU because it has no 3D acceleration whatsoever !
As Pcercui already said here, the software renderer in Cannonball is abyssal.
It's only after they worked on the GLES renderer that the game would run almost 60 FPS with the Vivante core, one of the few games to do so on the GCW.  (I pulled many of my hairs due to the many bugs and slowness in the etnaviv's version shipped in the GCW0's firmware)

It would require many changes. One of my project i was planning to was to remove all of the boost code and make it slimmer.
Unfortunately, i gave up on that at some point because it was mostly pointless in the case of the GCW0.
It would also require me to make the software work in RGB565 and try to improve its speed somehow. (One of my ideas was to use graphics instead of the rom files and emulating the graphical engine...)
 
So yeah, it's not for everyone.
Title: Re: Cannonball (Outrun engine)
Post by: opt2not on June 02, 2018, 07:17:30 pm
Personally I?m happy with the 30fps. I?m just a stickler for controls, but have adapted to the sensitivity so far. I?m still looking forward to that dead zone setting whenever you get a chance to look at that.
Title: Re: Cannonball (Outrun engine)
Post by: gameblabla on June 10, 2018, 02:30:30 pm
I admit i did not add deadzone setting yet because i was busy trying to convert everything from 32-bits color depth to 16-bits.
Needless to say, it wasn't exactly straightforward.
@pcercuei If you wanna help fix the damn shadows (shadows under the trees are green rather than gray), that would be nice :P
https://github.com/gameblabla/Cannonballs/commit/357c4cdf62015bb24871bdedb1c759dc94e77466 (https://github.com/gameblabla/Cannonballs/commit/357c4cdf62015bb24871bdedb1c759dc94e77466)


(https://gameblabla.nl/img/cannonball-16bits.png)

Why even go through that trouble ? I actually worked on this so it can eventually be ported to the RS-97 with the software renderer.
According to pcerceui himself, this should greatly improve graphical performance. (especially since the bottleneck is drawing here)

However, because the damn shadows don't look properly, i'm flagging this as a beta, first post is still the previous version using 32-bits mode.
Beta OPK version

EDIT: Shadows are now fixed, download the latest version from first post.

I can't test it myself anymore so it's possible that it is not able to init the display. Let me know if this new version works.
Title: Re: Cannonball (Outrun engine)
Post by: opt2not on June 11, 2018, 07:21:48 pm
Thanks @gameblabla , I was able to test this beta out last night and it works on my GCW.  I even set it to 60 fps, and for the most part its running a lot faster than the 32-bit colour version. There are some slow-downs here and there, depending on what's being displayed, and the music sounds choppy at the beginning of the race, probably because it's one of those areas with a lot of sprites on-screen.

The shadows are indeed the wrong colour, but it's not just on the trees. Even the shadow under your car is a different colour -- on my screen it looks more Cyan than Green:
(https://i.imgur.com/TPuwEKV.jpg)

I noticed that the car's cyan shadow colour is like this for most of the "zones", but there are some areas of the game the shadow changes back to grey. I didn't get to pinpoint when this happens, but there were 1 or 2 zones that it would change.

But other than these minor colour differences, the conversion to 16-bits is definitely running better, especially when you enable 60fps.

* one more thing I noticed is if you set the game to 30fps, it does not render. The screen just goes black. You have to set it to the game's "Original Settings", rather than the 30fps when you don't want to run it at 60fps.  The hard 30fps setting seems to be broken atm.

Thanks a lot for you hard work on this. It's almost there!
Title: Re: Cannonball (Outrun engine)
Post by: gameblabla on June 12, 2018, 03:05:46 am
Thanks for testing btw !
I found a way for correct colors on shadows (https://github.com/gameblabla/Cannonballs/commit/014815fbfa874b52e42348d36902a2e423783bf5), it should look properly now.
I don't know why it's crashing when setting things to 30 FPS... perhaps it's a GCC bug ? I hit some issues with that game if optimizations were too aggressive...

In any case, i now consider it to be stable. I'll add the deadzone setting later, hopefully the improved speed also improves the responsiveness.
Download link in the first post
Title: Re: Cannonball (Outrun engine)
Post by: opt2not on June 12, 2018, 10:01:36 pm
I can confirm the shadows are now fixed in this version. Still running good at 60fps!

It still feels the same in regards to the analog responsiveness, but with the smoother framerate its slightly better.

Thanks again for another update!