March 17, 2014 at 7:57 am #685
Every game console should have a car game, right ?
OutRunduino work-in-progress video 1, running on my TVout SFML framework for Windows. I will test soon on Arduino, should be about 80% of this speed, if memory doesn’t out run 🙂
Road calculations are based on lookup tables (for speed, as no calculation is needed). This is the reason for artefacts when road shifts. I need to add another lookup table for more accurate perspective shifts.
March 17, 2014 at 9:21 pm #1891March 18, 2014 at 12:37 am #1892
- This topic was modified 5 years, 4 months ago by Michael.
WOW, I’m really impressed. That looks fantastic. I also hope you have enough memory! After the framebuffer uses 1.5K, there’s only 500 bytes left for variables and stack. I had to be very stingy and creative when making Asteroids.March 18, 2014 at 7:33 am #1893
Yes. Memory is going to be tight. I need to test on a real Arduino very soon.
I use as much hard coded constants and progmem lookup tables as possible (<-might be too slow tho). While it looks like a lot is moving on screen, in reality there are not so many variables in play. I can also cut down on vertical framebuffer height (sky) if I run out of stack. I want to scroll the background by using TV.shift. I have tested it and it could give a big speed boost. The road gets shifted also, but since its updated per every frame, it doesn’t matter. I could really use a version of the Asteroids overlay bitmap routine that draws vertical column of a bitmap extracted from a given point in the bitmap data – even described in pseudocode… 😉 And, on another note: Just think about the possibilities here, Hackvision Special Edition Kickstarter, with Outrunduino firmware, bundled with airbrush art poster and a C-cassette with game music tracks …. oh the coolness! *grin* O0 <- its a joke, no need to get worried.March 18, 2014 at 10:50 pm #1890
I’m very confident in this game idea. I made the engine resolution independent. I was able to run at very low res and yet maintain a good feeling. Linked here is a video of running in 104×56 res. This means I have ways of cranking up speed and freeing memory for traffic and other gameplay improvements!March 19, 2014 at 1:19 am #1894
Looks great at lower res! KEEP GOING!March 23, 2014 at 9:43 pm #1899
Work-in-progress video episode 4 … palms and pesky Porsches !!March 25, 2014 at 8:25 am #1900
Update 5: 1st run on real hardware
This was my first attempt to take the game from SFML on Windows to real HW. It took about 1 hour, I need to put #define switches into the code for enabling/disabling Arduino specific code (progmem access, random, inclusion of Arduino.h and some types)
Flash remaining: 15 kB
RAM remaining: 614 B
Speed is very good, in fact its too fast as you can see from the Z count running over rather quickly on the left hand screen corner.
Also, unoptimized road curvature (30 x float) and road edges lookup tables (3 x 30 ints) are still in RAM !
So basically I have 15 kB to add game graphics and gameplay and around 900 B remaining for game variables.
The screen buffer is now only 728 B, so perhaps in the end I can even crank up the resolution.
I am pretty amazed at what the tiny atmega 328 can actually do.March 25, 2014 at 2:17 pm #1901
That’s fantastic. You are a very talented programmer. I’m impressed you have so much memory left. I agree that it is quite amazing how fast the ATmega328 runs when doing this sort of development. Memory is the constraint, not speed. I’m some of the other things I do (audio processing with the Audio Hacker shield), it’s the other way around. CPU speed is the limiting constraint, but memory is no issue.
Let me know when the game is “done” and I can put it on the games page. No hurry.March 25, 2014 at 5:32 pm #1902
Thanks for the compliment Michael.
I don’t know what it is about having to deal with limited resources that really appeals to me. I also play around with ARM Cortex processors and I have Olinuxino embedded Linux boards, but … the more memory and processing power I get, the less it seems to interest me 😉
You will not see a finished game soon. I want the end result to look impressive and be genuinely fun to play – in a way that people will be amazed that they can get so much game out of a measly atmega328. If I get twisty winding roads with altitude changes, various landscapes and most of all a similar “crossroads” system as in Outrun then it will be mission accomplished. Lets see how far this can go.
My real concern now, as I put in another post on the bulletin board, is sound. I am wondering how to create engine and screeching type sounds. I’ve thought about distorting the sound output by involving some other pin, or perhaps even involving some external circuitry. It’s stretching the Hackvision format a bit, but I think that’s what hacking is about, adding bits and pieces, not just by coding but also by soldering. I want to generate the kind of saw-tooth wave (?) rough sounds that the games of yore had. TVout.tone might be good for melodies, but I want effects: crackling, buzzing, popping crap that is more noise than sound.
What would you do, if hypothetically you were a coin-op game designer circa 1982 and had to improve the sound capabilities of your arcade driving game – as cheaply as possible ?
I’d appreciate just a pointer to some direction to start looking & experimenting. Sound (unlike graphics) has never been my domain.April 10, 2014 at 6:36 pm #1912April 10, 2014 at 8:58 pm #1913
simply incredible. I’d wager that this is the most sophsticated Arduino-based video game of all.April 11, 2014 at 7:37 am #1903
When I started this, I had a hunch that I need to be able to develop in a smarter and faster way. Porting the TVout to PC was a very good first move.
– The whole road algorithm is now done using 3 integer lookup tables. All the rest is done by combining the lookup values with multipliers and modifiers.
– The alpha bitmap was a pain to develop because I needed to come up with a logical operation that would combine the screen, the bitmap and the alpha channel in such a way, that all 7 different logical states would result in the correct output. All “simple” solutions ended in 1 state inverting a pixel or some other misery.
If I would have had to do all that tweaking by uploading to Arduino it wouldn’t have been slow, it would have been impossible. I only have a couple of hours now and then to work on this.
To give others the opportunity to do the same, I have opened a git repository for my SFML port of the TVout library. I have also shifted over to Linux for the development. In Linux its plug-and-play.
for git clone:
and a lousy instructional video:
If you wish to share this information on your Hackvision page, you are more than welcome to do so.
The OutRunduino work-in-progress files are also under my account, but those I do not wish to be linked or announced, as the code is far from stable.
Let’s hope we will see more sophisticated Arduino games in the future ! I have been directly contacted by at least two people, that’s what made me put the code on github.June 11, 2015 at 10:11 am #2280johnniewalkParticipant
Looks good but still lot to do! all the best.
- You must be logged in to reply to this topic.