A 3D racing game for casio PRIZM calculators - a fork from https://github.com/duarteapcoelho/prizm_racing
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
||6 months ago|
|gint||6 months ago|
|prizm||7 months ago|
|resources||6 months ago|
|sdl||7 months ago|
|src||6 months ago|
|.gitignore||6 months ago|
|LICENSE||7 months ago|
|Makefile||6 months ago|
|README.md||6 months ago|
A 3D, multiplayer racing game for casio fx-CG50 calculators
- 3D graphics
- Simple multiplayer (just connect two calculators)
- The multiplayer version runs at about 14 FPS and the singleplayer version runs at 24 FPS
8to accelerate and
- If you return from the menu, press any key to continue playing
- Tip: if you use
rightto turn and
8to accelerate, you can turn while accelerating
How to install
- Download the zip file from the releases page and extract it to get the
- Connect the calculator via USB and choose the
USB Flashoption (
- Copy the file to the calculator.
- In multiplayer, each player sees the other car behind where it really is, so it's possible that both players see themselves finish first.
- For multiplayer to work, both calculators must be running at the same frequency (if you overclock one, you must overclock both).
- The car's movement isn't totally independent from framerate, so it may be a bit more or less slippery if you're overclocking, underclocking, or using another calculator.
- This game also works on casio fx-CG20 calculators, but it's too slow (at least without overclocking).
- Running this game might cause file transfer to stop working. To fix this, reset the calculator by pressing the button on the back or removing and re-inserting a battery. This doesn't delete any files.
- If you connect the cable while one calculator is in the menu, it might start trying to receive files. To avoid this, only connect the cable while the game is running on both calculators.
How to build
prizm sdk version (with multiplayer)
This version supports multiplayer, but it's slower than the gint version.
- Set up the Prizm SDK (PrizmSDK Setup Guide)
- Set the FXCGSDK environment variable to where you installed libfxcg (
export FXCGSDK=...), or put the prizm_racing directory in
Windows (pirzm sdk version)
- Download the Prizm SDK (https://github.com/Jonimoose/libfxcg/releases)
- Make sure the path to the SDK doesn't contain any spaces
- Put the
gint version (singleplayer only)
This version doesn't support multiplayer, but it runs faster and doesn't have a border.
- Install gint (https://gitea.planet-casio.com/Lephenixnoir/gint)
- Install libprof (https://gitea.planet-casio.com/Lephenixnoir/libprof)
- All the rendering code is in
- Every triangle is clipped to avoid drawing triangles outside the screen. If a triangle is only partially inside the screen, it's cut in one or two triangles. This doesn't happen with the cones and the car to improve performance.
- The triangles are split into two (one with a flat top and another with a flat bottom) and rasterized.
- This renderer only supports diffuse directional lighting, because this way there is only one color per triangle, which increases performance.
- Because the calculator doesn't have a floating point unit (FPU), everything related to rendering uses fixed point numbers (defined in src/fp.h). This caused some issues related to precision, most of which were solved by checking where the floating point calculations were overflowing.
- To improve performance, the cones that are too far away from the camera are replaced with a simpler model and the ones even further away aren't drawn at all.
All of the multiplayer code is in
- When the game starts, a second car is created outside the track.
- Every frame, each calculator sends its
cardata (position, direction, etc.) to the other one over the 3-pin cable
- If the calculators are connected, the other one receives the data and updates its
- Otherwise, the enemy car doesn't move, and stays outside the track.
- To synchronize the byte stream, each byte of data sent is in this format: 0 0 0 X A B C D, where X is 1 if it's the first byte sent in a frame, and A B C D are four bits of car data.
Improving this would be possible by synchronizing both calculator's clocks to measure the delay, and then trying to predict where the other car will be that time in the future, but I think it's better to keep the multiplayer simple.