Hello!
Marble Run is an NES game that I've been working on for some time and I think it is about done. I have tested this only on the FCEUX emulator, so there may be some bugs...
The idea is to collect all items and go to the exit as fast as possible. The game features 5 levels and some pretty smooth physics. Achieving a 3-star grade requires some non-obvious maneuvering, so each level has a "View Demo" feature that shows an example of how to achieve it for that level.
The NTSC ROM image and some screenshots are included as attachments.
Marble Run
Moderator: Moderators
-
- Posts: 3
- Joined: Tue Jul 03, 2018 2:41 am
Marble Run
- Attachments
-
- marble_run.nes
- (40.02 KiB) Downloaded 375 times
-
- marble_run-0.png (2.26 KiB) Viewed 5577 times
-
- marble_run-1.png (1.58 KiB) Viewed 5577 times
-
- marble_run-2.png (1.82 KiB) Viewed 5577 times
-
- marble_run-3.png (1.96 KiB) Viewed 5577 times
- rainwarrior
- Posts: 8759
- Joined: Sun Jan 22, 2012 12:03 pm
- Location: Canada
- Contact:
Re: Marble Run
That's cool. Thanks for sharing!
-
- Posts: 49
- Joined: Fri Apr 07, 2017 5:02 pm
Re: Marble Run
Pretty fun little game, nice job. And it does indeed work just fine on console with Everdrive.
- FrankenGraphics
- Formerly WheelInventor
- Posts: 2076
- Joined: Thu Apr 14, 2016 2:55 am
- Location: Gothenburg, Sweden
- Contact:
Re: Marble Run
Once i saw it i knew i'd like it. It's super hard for me (i haven't beaten a single stage after 30 minutes) but it's still fun.
Re: Marble Run
That's interesting! How did you do the physics?
-
- Posts: 3
- Joined: Tue Jul 03, 2018 2:41 am
Re: Marble Run
The first thing that might be worth mentioning is that it uses a CORDIC algorithm for vector magnitude calculation and normalization. CORDIC is an old algorithm that is very versatile, but I hadn't even heard of it before I started working on this project.pubby wrote:That's interesting! How did you do the physics?
Here is a nice description of the idea behind CORDIC: https://www.uio.no/studier/emner/matnat ... cordic.pdf
Another thing might be the broad phase collision detection. Since the ball radius is constant, it has been included in the object AABBs. The object AABBs are sorted by their minimum x-coordinates in ascending order, which allows the broad phase to quickly figure out the last AABB to check. There is also an index list that allows the broad phase to quickly figure out the first AABB to check.
I included an NTSC ROM image for a test program that shows the broad phase in action.
In the test program:
- AABB corners are dark green, if the AABB is not checked in the broad phase
- AABB corners are light green, if the AABB is checked and rejected in the broad phase
- AABB corners are orange, if the AABB requires a narrow phase check
The rest is just calculating contact points and contact plane normals, pushing the ball out of the static objects and applying impulses.
- Attachments
-
- broad_phase.nes
- (24.02 KiB) Downloaded 313 times