Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI Z80 => Topic started by: Scipi on September 12, 2010, 10:05:07 pm

Title: Metroid-like game
Post by: Scipi on September 12, 2010, 10:05:07 pm
I am going to create a metroid like platforming game for the 83+/84. I was going to write it in Ti basic using pixel graphics but now Im thinking of switching to axe parser.
Title: Re: Metroid-like game
Post by: nemo on September 12, 2010, 10:25:41 pm
How much do you know about axe? You may want to start with something smaller if you haven't programmed axe much
Title: Re: Metroid-like game
Post by: Scipi on September 12, 2010, 10:27:54 pm
I've programmed with TI basic for several years now. I heard that axe has TI basic like syntax. I think Ill be ok.
Title: Re: Metroid-like game
Post by: nemo on September 12, 2010, 10:29:50 pm
The syntax is similar, but the semantics are much different. It's like c vs java. Similar syntax, but oriented for different things.
Title: Re: Metroid-like game
Post by: guy6020665 on September 12, 2010, 10:30:06 pm
Though Axe has BASIC like syntax there are some functions that have been changed from BASIC. Ex. Basic: randInt(1,10)  Axe: rand^10+1
Title: Re: Metroid-like game
Post by: calcdude84se on September 12, 2010, 10:31:39 pm
Though at any rate we community members will always be willing to help.
Good luck! :D
Title: Re: Metroid-like game
Post by: meishe91 on September 12, 2010, 10:32:39 pm
What kind of programs have you made in the past? Also, although Axe has similar TI-BASIC syntax some things can get pretty advanced. But good luck with it. If you need any inspiration there are multiple Metroid games, one by our very own DJ I believe.

Edit:
Part about Axe got ninja'd.
Title: Re: Metroid-like game
Post by: nemo on September 12, 2010, 10:33:15 pm
Though at any rate we community members will always be willing to help.
Good luck! :D

Of course :). Though I do suggest making some small games first, if you choose axe.
Title: Re: Metroid-like game
Post by: Scipi on September 12, 2010, 10:37:44 pm
I've made two RPG's, one was text based and another was a full one with multiple levels, leveling up, and random monster encounters. I've modifies a pong game to include another ball, and a peg randomly placed so it can move the ball if things get repetitive.

Thanks for the fore-warnings. Is there any source code I can look through?
Title: Re: Metroid-like game
Post by: DJ Omnimaga on September 12, 2010, 10:42:00 pm
As some other people said, I recommend you do not start too large as your first Axe projects, because while graphical functions may be a bit similar as BASIC, some stuff is different, like pointers and memory stuff. However, if you learn Axe, do some programs, experiment with physics and game engines, then realize you got the grasp of it, then I guess you could take on a moderately large project. Just remember there are many things to code in a Metroid game, such as enemies and bosses, grabbing items, collision detection and physics.

As my first calc game ever, in BASIC, I made a small RPG with one single dungeon split in two parts, one enemy, magic spell and broken level system.

Otherwise, good luck! Also, another important thing is to do backups very often.

Supersonic ball has no set release date yet, as I progress really slowly on it, but eventually I may release some source code for people who wants to work on physics (or help). For source code, you can look at the Your projects: Post and Critique and the Routines thread, as well as the example programs provided with Axe. Keep in mind that some programs in the projects/routines topics in the Axe forum are several months old, though, and the code may need to be modified to run on newer versions of Axe.
Title: Re: Metroid-like game
Post by: Scipi on September 12, 2010, 10:44:13 pm
Cool thanks. Does axe run on the 84 emu? And do you write it on the calc or on the computer and send it to the calc?
Title: Re: Metroid-like game
Post by: nemo on September 12, 2010, 10:45:24 pm
I'd start by learning hex and binary if you aren't *very* familiar with them already. I'd start by displaying a simple tile map.
Title: Re: Metroid-like game
Post by: Scipi on September 12, 2010, 10:46:46 pm
Hex I might be able to handle. binary... **shudders**.
Title: Re: Metroid-like game
Post by: DJ Omnimaga on September 12, 2010, 10:48:31 pm
You can write Axe programs on calc with the BASIC editor, on the PC using TI-Graph Link (requires Windows XP or below, I believe)or another basic editor.

Also Axe Parser is compatible with the TI-83+, 83+SE, 84+, 84+SE and the TI-Nspire 84+ mode.
Title: Re: Metroid-like game
Post by: nemo on September 12, 2010, 10:48:57 pm
Binary isn't as necessary, just if you're dealing with a lot of bit operations. Hex is more important though. Do you know about bytes bits nibbles etc?
Title: Re: Metroid-like game
Post by: Scipi on September 12, 2010, 10:51:15 pm
bytes bits nibbles yes I do know, I also know about bit operations.
Title: Re: Metroid-like game
Post by: nemo on September 13, 2010, 12:25:20 am
here are some basic ideas about axe:

data is generally defined as hex in [] brackets. [112233010203] defines 6 bytes of data in hexadecimal with the decimal equivalents 17,34,51,1,2,3. data can be defined with the command Data(). Data(17,34,51,1,2,3) is equivalent to [112233010203]. note that you cannot define a number greater than 255 with this method. though, Data(256r) would work, but it would also take up 2 bytes in memory.

pointers are central to axe. for example, [112233010203]->GDB1. GDB1 is a pointer to the start of the 6 bytes of data. you can access a certain byte of data at a pointer by using {} braces. so {GDB1} = 17. {GDB1+1} = 34, and so on. variables A-Z + theta are pointers. they are 2 bytes, therefore hold values 0-65535. if you subtract 1 from 0, you get 65535. if you add 3 to 65534, you get 1. rarely if ever do you use curly braces {} with just A-Z or theta inside.

here's a basic program that displays a basic 5x5 tilemap:
Code: [Select]
.AXE .This is the header, it describes the program's title. periods denote comments in axe.
[0101010101->GDB1  .GDB1 points to the beginning of the hex data.
[0101000101            .GDB1+5 would retrieve the first byte of this line, because it is 5 bytes after the start of the data.
[0100020001
[0101000101
[0101010101
[0000000000000000]->Pic1 .this is 8 bytes defining an 8 pixel by 8 pixel white square, which Pic1 points to.
[FFFFFFFFFFFFFFFF]          . this is an 8x8 black square.
[3C7EFFFFFFFF7E3C]          .This is a black circle represented by hex data.
For(Y,0,4 . 5 tiles high
For(X,0,4 . 5 tiles wide
Pt-On(X*8,Y*8,{Y*5+X+GDB1}*8+Pic1
.Y*5 is a vertical offset. when Y = 0, the byte retrieved by the curly braces {} is in the first line we defined.
.When Y=1, 5 is added to the offset, meaning the byte retrieved is now in the second row.
.X is the horizontal offset. You'll notice in our defined data, the values range from 0 to 2.
.Since Pt-On takes a pointer to an 8x8 sprite (which is 8 bytes of data), we multiply by 8.
.this means that if the byte in the tilemap is 0, the sprite displayed is the 8 bytes after Pic1. which is a white square.
.If the byte in the tilemap is 1, the sprite displayed is the 8 bytes after Pic1+8, which is a black square.
.and lastly, if the byte in the tilemap is 2, the sprite displayed is 8 bytes after Pic1+16, or the black circle.
End:End
DispGraph  .This updates the screen
if you put the DispGraph into the nested for() loops, you'll notice a significant slowdown, but you'll see the drawing of the sprites 1 by 1.
Title: Re: Metroid-like game
Post by: Quigibo on September 13, 2010, 01:05:41 am
The largest semantic obstacle when learning axe is Pointers.  If you've never programed in a language that uses pointers before, you might have a hard time getting used to it.  The Wikipedia article (http://en.wikipedia.org/wiki/Pointer_(computing)) about them is good, but its pretty technical and most of the examples are with C syntax.  The second important thing to be aware of is the difference between signed and unsigned numbers,  operations, and what you can actually store in the built in variables which are 16-bit integers instead of floats.  Once you get past those 2 things, you'll start having a lot of fun because you get a lot of power, some times too much when it causes ram clears or freezes, so be sure to use it responsibly and archive/backup anything important.

You can start on a big project if you want, but you'll want to have every important function as a subroutine so that you can work on the project step by step.  For instance, first write a routine "Draw Tile" that draws a tile and run the program to test it out.  Then, try to make a new routine "Draw Map" which calls the tile drawing routine to draw your tiles according to an array.  Then "Scroll Map" which scrolls the tile map, etc.  So as long as you keep working on smaller sections of code at a time, you might be able to manage a somewhat large project at the same time as you learn the language.  Good luck on your project!
Title: Re: Metroid-like game
Post by: Builderboy on September 13, 2010, 01:34:12 am
This sounds interesting!  What are you planning in terms of enemies and items and weapons and features?  And as the others have said, Axe has similar syntax but some of the concepts are deifnetaly new.  If you have never coded a platformer before i definetaly recommend playing around in whatever language you plan to use and figure out how you are going to get your physics to work.
Title: Re: Metroid-like game
Post by: DJ Omnimaga on September 13, 2010, 01:39:58 am
Yeah I remember I had serious trouble with them at first x.x (as well as storing to/reading from application variables). Thankfully I finally got used to them but you might want to check through some topics posted a while ago in the Axe sub-forums for them too.

To add to Quigibo comment on making your project in parts, if possible, I recommend still splitting your games in multiple files (and backing up regularly even on a computer or flash drive) even once you are very used to Axe. This makes it easier to scroll through code and data.

A large project by a beginner is possible, though. Maybe not by everyone but it can be possible by some people. tr1p1ea is one example (Desolate starting a few months after he starts learning ASM)
Title: Re: Metroid-like game
Post by: ztrumpet on September 13, 2010, 04:33:43 pm
This sounds like a cool project.  Good luck on it, as well as learning Axe.  If you want, feel free to look through the source to Axe Snake and Spider (click the ticalc banner in my sig to find them).  I hope you learn Axe and make this game, and many more. :)
Title: Re: Metroid-like game
Post by: Scipi on September 14, 2010, 10:33:07 pm
Quote
here are some basic ideas about axe:

data is generally defined as hex in [] brackets. [112233010203] defines 6 bytes of data in hexadecimal with the decimal equivalents 17,34,51,1,2,3. data can be defined with the command Data(). Data(17,34,51,1,2,3) is equivalent to [112233010203]. note that you cannot define a number greater than 255 with this method. though, Data(256r) would work, but it would also take up 2 bytes in memory.

pointers are central to axe. for example, [112233010203]->GDB1. GDB1 is a pointer to the start of the 6 bytes of data. you can access a certain byte of data at a pointer by using {} braces. so {GDB1} = 17. {GDB1+1} = 34, and so on. variables A-Z + theta are pointers. they are 2 bytes, therefore hold values 0-65535. if you subtract 1 from 0, you get 65535. if you add 3 to 65534, you get 1. rarely if ever do you use curly braces {} with just A-Z or theta inside.

Thank you for the example. It helped.

Quote
The largest semantic obstacle when learning axe is Pointers.  If you've never programed in a language that uses pointers before, you might have a hard time getting used to it.  The Wikipedia article about them is good, but its pretty technical and most of the examples are with C syntax.  The second important thing to be aware of is the difference between signed and unsigned numbers,  operations, and what you can actually store in the built in variables which are 16-bit integers instead of floats.  Once you get past those 2 things, you'll start having a lot of fun because you get a lot of power, some times too much when it causes ram clears or freezes, so be sure to use it responsibly and archive/backup anything important.

Thanks for the link. So pointers are something that start at the beginning of data in memory.I know about signed/unsigned and operations.

Quote
To add to Quigibo comment on making your project in parts, if possible, I recommend still splitting your games in multiple files (and backing up regularly even on a computer or flash drive) even once you are very used to Axe. This makes it easier to scroll through code and data.

I did that with a text based RPG I was making a while ago. Had one for the story, battles, store/inventory, and beastary.

Quote
This sounds interesting!  What are you planning in terms of enemies and items and weapons and features?  And as the others have said, Axe has similar syntax but some of the concepts are definetaly new.  If you have never coded a platformer before i definetaly recommend playing around in whatever language you plan to use and figure out how you are going to get your physics to work.

I don't lnow yet for enemy types. I guess Ill make that up as I go along. I definately wamt some kind of uber weapon as an easter egg. And I plan on having other easter eggs/unlockables.

Quote
This sounds like a cool project.  Good luck on it, as well as learning Axe.  If you want, feel free to look through the source to Axe Snake and Spider (click the ticalc banner in my sig to find them).  I hope you learn Axe and make this game, and many more. Smiley

Thank you Ill definitely look into them.
Title: Re: Metroid-like game
Post by: meishe91 on September 14, 2010, 10:44:18 pm
It might be easier if you plan out what you want ahead of time, that way you won't be adding or changing a bunch of stuff in the middle of development. Might save some headaches. Just a thought.
Title: Re: Metroid-like game
Post by: DJ Omnimaga on September 14, 2010, 11:32:46 pm
True. I had all game events for Metroid written on paper somewhere, like boss orders, items, where energy tanks may be, an idea of where each map sectors are located. It's also a good idea to get some tiles/sprites before starting but not too many eithers, since you may not use them all.
Title: Re: Metroid-like game
Post by: nemo on September 14, 2010, 11:35:53 pm
True. I had all game events for Metroid written on paper somewhere, like boss orders, items, where energy tanks may be, an idea of where each map sectors are located. It's also a good idea to get some tiles/sprites before starting but not too many eithers, since you may not use them all.

like DJ said, sprites are a good idea, but placeholders are perfectly fine. if you're using a 3 level grayscale enemy, make a 3 level grayscale enemy that took about 5-10 minutes, perfection isn't important. if you're convinced you're going to use the enemy, then perfect it/ask on the boards for someone to draw you a good enemy.
Title: Re: Metroid-like game
Post by: Scipi on September 14, 2010, 11:37:32 pm
Thanks for the idea. I will try to do that.
Title: Re: Metroid-like game
Post by: DJ Omnimaga on September 14, 2010, 11:44:47 pm
Oh, also, feel free to use some of my Metroid sprites in Metroid II: Evolution/Expansion. Keep in mind that the following are not by me, though: Mother Brain, Kraid/Chozo, Samus and enemy 3/4. Some were converted by me from the GB game and the rest were done myself.