Switch to full style
Advice on general approaches or feasibility and discussions about game design
Post a reply

Re: Cruiser - a 3D shooter for the Gamebuino

Thu May 11, 2017 11:09 am

Thanks! I have a Ruby script (map.rb on Github) which I use to declare convex segments, via relative "line to" statements, similar to how turtle graphics works.

The script then finds aligned segment walls and turns them into portals. It writes a header file, map.h and a visualization of the level so that I can see that everything's where it's supposed to be.

Re: Cruiser - a 3D shooter for the Gamebuino

Thu May 11, 2017 4:51 pm

http://playground.arduino.cc/Main/SpiRAM Here you go. You might be able to use the I2C pins to drive the chipselect and reset pin of the serial RAM while using the ICSP header for MISO, MOSI and SCK. I think that MAKERbuino contains all of these pins on a header so if you can make a good PCB, you might make a serial RAM expansion module.

Now, if this rendering and the recursions take up a lot of RAM, could you possibly remove the framebuffer and render the frame by sending data onto the display dynamically? That way you could get more memory. If not, how are you going to have the in-game score, lives, NPC data, SD-card library footprint and more?

In Atmel Studio, I saw that there's a neat feature where you can set up where your CPU stack pointer is initially. If you can be sure that you won't cause a stack overflow and if you can set up the stack pointer as low as possible such as at 0x700 and then have 256bytes for everything else, that might work well. Also, you can put the rendering engine's global variables into a union with some variables that are only used while you're not rendering the game such as when you're in the main menu of the game or the pause menu or something like that. That way while you're not rendering, that memory region is used for something else. Just be sure to re-initialize the rendering engine's variables after using their memory region for something else.

You can have every function check if the stack pointer has come too low before entering a new function. That way you can prevent a stack overflow.

If you'll have NPCs and as you say you don't have much RAM, you can have every NPC have a variable that says what it should do next such as move forward, shoot, turn, run, die, etc. and have all the behaviors pre-programmed as a script in the Flash memory.

Re: Cruiser - a 3D shooter for the Gamebuino

Thu May 11, 2017 5:56 pm

if its full 3D can you have stacked rooms?

Re: Cruiser - a 3D shooter for the Gamebuino

Thu May 11, 2017 8:45 pm

It seems to be by the demo.
Better release a newer demo showing that off already just to make sure... ;)

Re: Cruiser - a 3D shooter for the Gamebuino

Fri May 12, 2017 8:42 am

nhcham wrote:The level doesn't use any RAM at all, it's all stored in flash memory and it doesn't even take up that much space (518 bytes as of now). What fills the RAM is the local and global variables like frustum planes (portal engines are rendered recursively), the shots, the camera, and the stack frames resulting from function calls. Also for clipping you usually have an input and an output polygon and polygons use a lot of RAM, so I implemented a version that works in place, requiring only one polygon structure instead of two.
[...]

You could make it dynamically re-flash a level if the level-data is alligned, i did something similar for the somehow-dead community rpg with sound data (yes it would run on the vanilla gamebuino) ^.^

Re: Cruiser - a 3D shooter for the Gamebuino

Wed Jul 12, 2017 12:48 pm

AMAZING GAME!
You are the Code Master! :o
Post a reply