Jump to content
IGNORED

Moto-X (WIP 2600 Homebrew)


walaber

Recommended Posts

Now that Wall Jump Ninja is basically finished, I've started working on an idea I've been thinking about for a couple weeks now... a motor-cross / excitebike / trials type game. the "port" of tubin' I started earlier isn't nearly as exciting to me as this, so I think this'll be my next project.

 

So far I've just worked out how I think the main kernel should work, and got a proof-of-concept up and running in Stella. For this I want smooth horizontal scrolling, and also for the jumps and terrain to be as smooth as possible.

 

I've accomplished it by using an asymmetric playfield for the rough details, and then the ball and both missiles (set to 8 clocks wide) translated every few scanlines to describe the actual details of the jumps. this means I have to share colors between most objects, so this will likely be another "silhouette character against a colorful background" just like ninja was. I'm also limiting the vertical space that the course can occupy in order to get this all to fit in RAM. I'm also cropping horizontally so I can completely ignore the 4 bits of PF0 on each edge of the screen.

 

I'm pretty happy I got the kernel to work! the other good thing about this kernel is that it should be quite efficient to store level data, as the actual playfield and jumps can be computed from just a few pieces of information (basically a list of jumps from a pre-determined set, and how far they are apart from each other).

 

I'm expecting to keep the game quite simple, since I want to spend the rest of the ROM space on rotation frames for the player so that you can do flips :)

My goal is another 4K game this time.

 

here's a WIP screenshot, and one with Stella's debug colors turned on, so you can see technically how it's done.

post-40857-0-49526900-1420151360_thumb.png post-40857-0-16103400-1420151365_thumb.png

  • Like 8
Link to comment
Share on other sites

I've thought a little about the physics, yeah. I'm assuming I'll definitely have to be using a lot of 16-bit "fixed point" math to make everything smooth. I'm not sure how realistic I want to simulate the physics just yet... probably some fairly realistic aspects like gravity and acceleration, but simplified physics for flipping/landing/doing wheelies, etc. we'll see how it goes!

Link to comment
Share on other sites

Gravity and acceleration are very easy to implement, but everything else requires a lot of physics if the game should feel right.

 

For the rather simple tow bar physic in Thrust I had to do a lot of research and experimenting, your physics are much, much more complicated. I suggest that you do some research and maybe use a different platform and language for experiments.

Link to comment
Share on other sites

I think this looks good, I think some good physics would really set this game appart if its done well.

 

I am looking at implementing a horizontal scrolling playfield too, I may follow your idea of ignoring the PF0 as it saves space and time in the main kernel.

Link to comment
Share on other sites

Gravity and acceleration are very easy to implement, but everything else requires a lot of physics if the game should feel right.

 

For the rather simple tow bar physic in Thrust I had to do a lot of research and experimenting, your physics are much, much more complicated. I suggest that you do some research and maybe use a different platform and language for experiments.

 

I've a fair amount of experience writing physics, I created a game on PC / Mobile called "JellyCar" which had a custom soft-body physics engine that I wrote. I'm not worried about the math, I just need to balance what I can afford from a CPU cycle perspective, and also learn how to do basic signed fixed point math in 6502 asm :)

 

... and of course tune the model to what plays well.

Link to comment
Share on other sites

enlarged and with non-square pixels

 

I'm impressed, there isn't many pixelists who care and can compensate for this in their design.

Very fluid animation, and greatly defined frames. Not even one messy "transition angle", each sub-picture is perfectly translated into the medium of small rectangles.

 

Very well done!

:)

Link to comment
Share on other sites

progress has been slow, but still moving forward.

 

today I wrote myself a little python program to batch convert individual PNG files in a folder into a "graphics.inc" file that properly formats the data into 8-pixel wide strips of data, suitable for using with player sprite graphics. This allows me to easily take my photoshop/pixel images I create, and convert them into data for the game. I know other tools are around to do this, but all the ones I could find seemed to be either web-based, or only for Windows (I'm on a Mac).

 

Other people might find this useful, so here's the python code (it requires the PIL image library):

import sys
import os.path
import math
from PIL import Image

# this will be the string data we want to write to graphics.inc, formatted for DASM
final_output = '\tMAC GRAPHICS\n'

for filename in os.listdir('./'):
	base = os.path.splitext(filename)[0]
	ext = os.path.splitext(filename)[1]

	# currently only support PNG files.
	if ext == '.png':

		print 'processing ' + filename + '...'

		img = Image.open( filename )
		img_size = img.size

		# convert to 1-bit on/off.
		img = img.convert("L")

		sections = int(math.ceil(img_size[0]/8))

		for s in range(sections):

			section_name = base + "_" + str(s)
			
			final_output += section_name + "\n"

			for y in range(img_size[1]+1):

				# don't forget to invert the image vertically...
				# and also give an extra line of pixels of zeros at the top (bottom).
				final_y = (img_size[1]-1) - y

				final_output += "\t.byte #%"

				section_comment = "\t\t;"

				for x in range(: 

					final_x = (s *  + x
					pix_val = 255

					if (final_x < img_size[0]) and (final_y < img_size[1]) and (final_y >= 0):
						pix_val = img.getpixel((final_x,final_y))

					if (pix_val <= 128):
						final_output += "1"
						section_comment += "X"
					else:
						final_output += "0"
						section_comment += " "

				final_output += section_comment + "\n"

			final_output += "\n"

final_output += "\tENDM"

text_file = open("graphics.inc", "w")
text_file.write(final_output)
text_file.close()

you use it by running in the directory with the PNG files:

python process_images.py

this creates a file called "graphics.inc" with entries that look like this:

	MAC GRAPHICS
bike_0000_0_0
	.byte #%00000000		;........
	.byte #%01110000		;.XXX....
	.byte #%10001000		;X...X...
	.byte #%10111111		;X.XXXXXX
	.byte #%10001111		;X...XXXX
	.byte #%01110110		;.XXX.XX.
	.byte #%00001111		;....XXXX
	.byte #%01111111		;.XXXXXXX
	.byte #%00011100		;...XXX..
	.byte #%00000111		;.....XXX
	.byte #%00000011		;......XX
	.byte #%00000001		;.......X
	.byte #%00000000		;........
	.byte #%00000000		;........
	.byte #%00000000		;........
	.byte #%00000000		;........
	.byte #%00000000		;........

bike_0000_0_1
	.byte #%00000000		;........
	.byte #%00001110		;....XXX.
	.byte #%00010001		;...X...X
	.byte #%11010101		;XX.X.X.X
	.byte #%11010101		;XX.X.X.X
	.byte #%11001110		;XX..XXX.
	.byte #%01100100		;.XX..X..
	.byte #%01111100		;.XXXXX..
	.byte #%10001000		;X...X...
	.byte #%00101000		;..X.X...
	.byte #%11011000		;XX.XX...
	.byte #%11000000		;XX......
	.byte #%01110000		;.XXX....
	.byte #%11010000		;XX.X....
	.byte #%11110000		;XXXX....
	.byte #%01100000		;.XX.....
	.byte #%00000000		;........
    
        ENDM

Note how it also puts comments in that make the graphic data a bit easier to see.

 

it puts all the graphic data into a macro called "GRAPHICS", so then in your main game code you can "include graphics.inc", and then wherever you want your data statements you just put "GRAPHICS" on a line, and they get pasted in there.

 

so I've now got my rotation frames into the program, and easily updatable, along with making it easy to add new graphics to the game. Up next I need to get a level format that properly creates playfield and ramp data, and then start working on the actual bike physics.

  • Like 2
Link to comment
Share on other sites

That's neat. Are all 1s in the source code colored that way now? Or only those within a binary number?

 

Only those preceded by %. In the right section you can see a bunch of 1s in the code:

post-3056-0-06978200-1421941405_thumb.png

 

The other nice thing about using jEdit is after some initial setup you can compile with DASM and launch the resulting ROM in Stella. More info in the Using jEdit for 2600 development topic I posted last September.

Link to comment
Share on other sites

Today I got some basic syntax highlighting working in Sublime Text that recognizes all of the opcodes and VCS.H keywords, and also does the same kind of fancy highlighting that SpiceWare has. Enough procrastinating, I need to get back to working on the game :)

post-40857-0-19961400-1422144652_thumb.png post-40857-0-03135200-1422144656_thumb.png

 

If anyone wants the syntax definition file, let me know and I'll post it.

 

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...