Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Octo Programming Questions Sticky

A topic by Internet Janitor created Aug 29, 2021 Views: 549 Replies: 10
Viewing posts 1 to 3
HostSubmitted(+1)

This thread is for short questions about Chip8 programming and the Octo assembly language. If you have a more involved question, feel free to start a separate thread.

Last year's thread can be found here.

Many common tricks and pitfalls are addressed in the Octo FAQ.

Okay for this game jam So it's any game using the Chip-8 code? How would you download the app or game I do not understand entirely.

HostSubmitted

The Octojam is all about writing software for the Chip-8 platform. You can use any tools you like to prepare a Chip-8 ROM, but Octo is a convenient tool for writing and testing such programs.

Octo can save a standalone .HTML document which bundles the Chip-8 ROM together with an emulator. You can then use this .HTML document on Itch to let others play your game directly in their web browser. Here's an example of a game I've published in the past using this method: https://internet-janitor.itch.io/expedition

You can additionally distribute the bare .ch8 ROM as a download on your game's submission page, for use with other Chip-8 emulators.

Does that make more sense?

It is sort of helpful since I sort of get the basics, but I don't know chip-8 as well as where to type the chip 8 code so I need to know where so that I have the opportunity to start the build. I looked at your example which is really cool. Do you have a video recommendation that helps me get basics down for chip-8 code? Also, for your game, I don't know where to go after i grabbed phone, charger, both right and left socks and shoes, coffee filter, pants and stuff, so where would I have gone next on that too? 

HostSubmitted

Octo doesn't have any video documentation, but there's a great deal of written material on the Octo Github page.

You might start with the Beginner's Guide, which doesn't assume any previous experience with programming or CHIP-8. You can also just try editing one of the example programs and clicking "run" to see what happens. Sometimes breaking a program can produce spectacularly interesting results!

Okay Cause I am not sure what game to make still. I am sad.

(1 edit)

I will try and get it all done this class period and next week.

how can you change the octo link cause I went to the octo from a guy named Johnearnest and the link says Johnearnest. I do not know how to change the link. I know deadline is right on the line but I not done at all yet. I am still trying to learn everything or beginner stuff. The other problem is that it won't open. I am trying to create a simple shooting game of objects but I have no idea how this is done. I am just worried I won't finish on or before November 1st. 

Submitted(+1)

IJ can correct me if I'm wrong, but John Earnest (AKA Internet Janitor) is the creator of Octo, which is hosted from his Github. However, the program you wrote should be automatically saved in your browser. That being said, you should probably make a note to occasionally download backups of your work (Toolbox > Binary Tools > Save .8o). 

What do you mean by "it won't open?" Is Octo not loading on your browser? Or are you unable to run your game at all? Are you downloading 8o files and trying to run them?

Submitted(+1)

I have a bunch of tiles stored in a single label (like a spritesheet). I'm using loops and ID numbers to identify and retrieve sprite information for each tile from the label, like so:

# ve is the ID of the tile that I want
i := tileset
vc := sprite_size
vd := 0
loop if vd < ve begin
  i += vc
  vd += 1
  again
end

I was just wondering if there might be a more efficient solution that I could be using. Especially if the data I want is further down the list.

HostSubmitted (1 edit) (+1)

You could calculate the index you need. This will require some consideration of the tile size:

Be careful of overflow. If you have lots of tiles, you might need to add to i multiple times. This technique also gets a bit fiddlier if you aren't using a power-of-two size, but it's still doable.

Another option is to just use pre-multiplied values as your tile IDs. If you don't have many tiles, this makes looking one up trivial!

In some situations, you could consider using self-modifying code to rewrite the address in an `i := NNN` or `i := long NNNN` instruction. This gets a bit fiddly, but if you have lots of tiles, or tiles that take up a lot of memory (like full-color tiles) it might be the most efficient option. There are some examples of these sorts of techniques in the FAQ, when discussing pointers.

Edit: Oh, and one other thing- while writing a loop like you did there does work, it would be more idiomatic to do something like:

Using == or != instead of < is more efficient when you can get away with it.