PDA

View Full Version : Super Heli Land



Darkhog
28-05-2013, 08:19 PM
Remember those helicopter stages from original Super Mario Land on the Gameboy? Well, I'm making game around that.
Similarly to such hits like Not Tetris, my project will offer unique twist to gameplay - it'll feature randomly generated (with option to set seed) perlin noise-based infinite levels. How far can you get?

Libs used: Allegro.pas (with OGG Vorbis addon).

Things I may include:

- Ability to switch between submarine levels and enemies and helicopter (not much gameplay value, mostly graphics thing)
- Boss run mode, where levels won't be infinite and will feature boss fight at the end, just like original SML heli/sub levels did.

For now, I'm figuring out Allegro but unless something bad happen (like me being unable to find perlin noise generation unit, preferably with offset function for easier generation of infinite landscape in chunks (http://www.pascalgamedevelopment.com/showthread.php?21325-mvNoise-Perlin-noise-problem)), this is pretty easy project to write. Graphics and music will be ripped from SML, obviously and will be scaled up 2x (w/out filters).

wagenheimer
28-05-2013, 11:53 PM
Interesting! Keep us informed! Screenshots when ready would be nice! =)

Darkhog
29-05-2013, 01:19 AM
It's a bit too early for screenshots ;). Still making engine. Need to make state machine (already did collision detection) and sprite animation routines, but that after sleep. Then I will test engine with some dummy graphics, after that... Mario Ripping Time!

//edit: Of course I'll post source code along with game - keep in mind tho that since it is my "training project" in Allegro.pas, probably most of it unless not written by myself, is The Daily WTF material.

Ñuño Martínez
29-05-2013, 11:14 AM
Great! Another Allegro.pas project. I'm sooooooo happy! :) :) :)

Darkhog
29-05-2013, 12:02 PM
Update: Currently figuring out world generator. I don't know how to make blocks appear on ground and not get buried (think way grass in Terraria is outside, but never inside of dirt). It is important, because I want to add some spikes here and there and those won't look good in mid-air or inside of ground.

Next on: State machine.

//edit: Also it is amazing, how much randomly plotted circles can do to generate cool cave.

Darkhog
30-05-2013, 07:46 PM
Project update: Started to move world generator stuff into it's own class and unit. I think I'll leave state machine for end.

Next on: Figuring out how to make collision with map (probably I'll use my custom TSprite class for that).

Darkhog
01-06-2013, 09:36 AM
I've figured out way to make sprite collisions. As I suspected, I'll use my TSprite class for that. Will need two sprites per chunk (one for blocks that just stop player and one for blocks that hurts him, like spikes) plus array of sprites for shootable blocks (will need to check for collision between bullet and any of those so I can remove them).

I've almost finished world generator. After I'll finish it completely I'll get to tileset stuff (such as rendering chunks to sprite objects and getting tile with specific ID from tileset).

SilverWarior
01-06-2013, 11:05 AM
I've figured out way to make sprite collisions. As I suspected, I'll use my TSprite class for that. Will need two sprites per chunk (one for blocks that just stop player and one for blocks that hurts him, like spikes) plus array of sprites for shootable blocks (will need to check for collision between bullet and any of those so I can remove them).

Why needing two sprites per chunk. Wouldn't it be better to just include additional information to a single sprite which would tell you what type it is.
At some point your would probably decide to include some AI controlled units. So would you use even more spites to determine their behaviro?

I belive it would be better to just derive the base sprite clss and add aditional information to it like is pasable, can be destroyed, its health, how much damage does it do. Combination of theese can be for instance even used for defining wall which would deal damage to the player oif it bumps into (spiked walls).

Darkhog
01-06-2013, 11:41 AM
Problem is that when checking for collision with one sprite (it's pixel-perfect by the way) I can't tell if part of sprite player is colliding with is spike or harmless object, hence two sprites per chunk - one for harmful things and other for harmless. Supposedly I could do like you are saying, but I'm too much of a n00b yet and I'm basically learning Allegro with this project so...

Also you are talking to guy who barely made world generation and pixel-perfect collision and only because I was given perlin noise unit and was able to (barely) translate pixel-perfect collision code for original Allegro (in C).

Darkhog
01-06-2013, 12:57 PM
Good news: World generator doesn't crash game (it did, but I got rid of the problem).

Bad news: It looks awful (fails to generate ground and traps. Will be posting help request thread in a minute.

laggyluk
01-06-2013, 01:26 PM
Problem is that when checking for collision with one sprite (it's pixel-perfect by the way) I can't tell if part of sprite player is colliding with is spike or harmless object, hence two sprites per chunk - one for harmful things and other for harmless. Supposedly I could do like you are saying, but I'm too much of a n00b yet and I'm basically learning Allegro with this project so...
collision sprite could have one color for marking harmful area and second for non-harmful, other colors could be also used if needed for other properties like bumpiness. This could be broken down to using one color channel for harmufulness and other for bumpiness to allow both on same surface :P
I think this info could be also encoded directly into single sprite image with some work.

SilverWarior
01-06-2013, 05:05 PM
Problem is that when checking for collision with one sprite (it's pixel-perfect by the way) I can't tell if part of sprite player is colliding with is spike or harmless object, hence two sprites per chunk - one for harmful things and other for harmless. Supposedly I could do like you are saying, but I'm too much of a n00b yet and I'm basically learning Allegro with this project so...

How big are your sprites? Are you using one sprite for whole map section?

Darkhog
01-06-2013, 06:48 PM
How big are your sprites? Are you using one sprite for whole map section?

Two sprites per chunk. One is for "harmless" blocks, like ground and other for spikes. All I need to know here is whether player collides with something harmful or not. I don't need anything fancy here. And chunk sprites will be pretty small (144x144px), so speed shouldn't be big issue.

Darkhog
07-06-2013, 11:42 AM
I got sidetracked a bit by making present for my Mom's upcoming birthday. Anyway, I'm planning to get into SHL today again.

Darkhog
07-06-2013, 07:51 PM
OK. Got worldgen working properly (I think). Now I need to make some finishing touches such as generating destructible blocks, then will get into actual chunk rendering.

Next thing will be to write class and code for animated sprites.

While SHL will require just one looped animation per object (if animated at all) such as Mario or enemies, I'll do it properly by writing reusable code that can take for any number of animations. So it'll take some time.

Darkhog
11-06-2013, 11:19 PM
Just some info: I've moved all Chunk-related things not related to world generation into its own class. This means I had to rename TChunk into TChunkData as TChunk is now class name (TChunkData = array of array of byte). This will lead to cleaner code. Now I need to finish some Tileset-related things.

Also you can track my progress here: http://livedo.sparklinlabs.com/qvear

Darkhog
13-06-2013, 12:54 AM
Ok. Worldgen is officially finished. Now I can get to other stuff, like tileset handling.

Darkhog
13-06-2013, 01:31 AM
Here's demo of world generator: https://dl.dropboxusercontent.com/u/210143/worldgentest.rar

Brown pixels on chunk are ground tiles, green are "ground coverage" tiles (in game it'll be seen like one of indestructible blocks in Super Mario Land), red are spikes and blue ones are destructible blocks.

Demo features two cats, one of which can be moved using arrows. They also collide, using pixel-perfect collision (using PMASK (http://sourceforge.net/projects/pmask/) method)!

Reason for strange executable name is that project was originally "hello world" type of deal, but I've figured out that by making actual game I would learn much more (and so far I did!).

Darkhog
20-06-2013, 04:10 PM
Project update: Finished TTileset class, now I need to get chunks to render with some actual tiles, not cranked up pixels. Mario ripping time!
//edit: Could tell me if you know of any full set of tiles from Super Mario Land? I'd rather not touch Tile Layer Pro unless it is absolutely necessary.

Carver413
21-06-2013, 12:18 AM
http://opengameart.org/
you should be able to find something to use here.

Darkhog
21-06-2013, 01:17 AM
Thanks, but I need tiles from Super Mario Land 1 for the Gameboy, specifically.

Darkhog
24-06-2013, 12:28 AM
Ok, I've ripped tiles I need for this project from SML rom using Tile Layer Pro (great program for rom hackers) and then masked them (as I'm using pixel-perfect collision, I need mask for each sprite so it won't collide where it shouldn't and collide where it should).

I've also started to code chunk rendering stuff and I'm dying to try it out, but I can't as it is not finished yet. Will be able to post some preliminary screenshots then.

SilverWarior
24-06-2013, 03:26 AM
Are you sure ripping the tiles is a good idea? Aren't you violating Intelectual Property rights from nintendo doing this?
I searched the web a litle and didn't find any information about Super Mario Land graphics being available to be used publicly.

Darkhog
24-06-2013, 08:23 AM
Well, Nintendo doesn't have issues with Mario fan games such as Mario Forever (I don't mean too hard for God SMB1 hack, I mean PC game with same name) unless you want $$$ for them so I don't think they'll have issue with freeware fan game.

Darkhog
24-06-2013, 09:10 AM
While my game currently segfaults, I've managed to take screenshot just before segfault occured:
http://i.imgur.com/o516yBh.png
This is how roughly game would look like. In top left corner you see how game "sees" chunk internally. As you can see, destructible blocks (represented by blue pixels) aren't rendered yet as they need special treating (instead of dumping everything in one big sprite one for chunk and one for traps, it needs to be rendered each sprite separately so game will know which one to remove when it collides with player's bullet). Ground blocks, while they appear to use two tiles, are internally rendered using one ground id with checking while drawing if x/y positions are even or odd numbers and select appropriate tile so it looks like here.

SilverWarior
24-06-2013, 07:11 PM
Well, Nintendo doesn't have issues with Mario fan games such as Mario Forever (I don't mean too hard for God SMB1 hack, I mean PC game with same name) unless you want $$$ for them so I don't think they'll have issue with freeware fan game.

Do you know that Nicker Iron game which is made by Eric was originaly named Missile Command and then he had to rename it becouse Atari acused him of violating their IP rights becouse the name of his game was the same as a 1980 game made by Atari.
I'm just saying for you to be cautios since IP right violations can lead to large and expensive lawsuits.

Darkhog
25-06-2013, 06:50 AM
True, but isn't that Nickel Iron game for sale? For freeware fan games it is entirely different. Also, as numerous mario games and parodies thorough the web has shown, Nintendo simply doesn't care.

SilverWarior
25-06-2013, 08:59 AM
Have you ever heared of the game UFO: The Two Sides?
It was remake of an old UFO Enemy Unknown game which added ability to play as aliens. And even thou the project was opensource they had to close it down due to Intelectual Property violation of original game.

Anywhay I just wouldn't like to see your project being screwed by some gaming company just becouse they were to envy on your sucsess. It might not happen ir it might.
To be honest I have seen to many potentionaly good games killed this way.

Darkhog
25-06-2013, 06:28 PM
For those who received my code and found it to be WTF-y (as in TheDailyWTF WTF-y): If you want to post it there, be my guest. But please keep in mind following things:

- Project isn't even in Alpha stage yet and there will be lot, I mean lot, of refactoring going on in following days
- This is my first game written from scratch (earlier I've either used engines like Unity or game making programs).

Anyway started to do refactoring now and code already looks better (lot of unused variables/functions got removed).

Darkhog
26-06-2013, 05:49 PM
I've started work on animated sprites.

Darkhog
27-06-2013, 03:57 PM
Implemented animated sprites and made simple spritesheet. Now I'll need to test it.

Darkhog
27-06-2013, 04:48 PM
Tested animation system. It works fine on my first try! I think I'm getting hang of allegro!

Anyway now I'll need to implement state machine and rip more graphics from SML (title screen and few others that would make background of options menu).

But that maybe tomorrow - you know, all work and no fun (note: Programming is fun, but I now want other kind of fun which is playing Remember Me)...

Darkhog
28-06-2013, 06:13 PM
Base class for states is done, now I'll do actual states. Of course, Main Menu will be first.

Darkhog
29-06-2013, 11:55 AM
And Main menu state is finished (kinda, still need to figure out what causes segfault when destroying it):
http://i.imgur.com/GotgJFJ.png

//edit: Currently only Exit option is working, as I have yet to make actual gameplay and option screen.

Darkhog
30-06-2013, 09:55 AM
Fixed segfault thanks to imcold. Thanks, man! You're great!

Darkhog
30-06-2013, 05:54 PM
Ok, few others segfaults has popped out, but was able to fix them myself. Now onto options menu.

Darkhog
30-06-2013, 09:13 PM
Newsflash: Most of options menu is done, only few bits are remaining, so soon I'll be able to show it off.

Frankly, it's amazing how much stuff you can get done in a month (and I had 2 weeks hiatus) - according to lpr file creation date, I've started SHL (was Hello World type of deal at the time, then inspiration struck) on May 28th, 13:51 (01:51 PM). I hope to have something playable next week, but time will tell if I can squeeze it.

Darkhog
01-07-2013, 09:29 PM
May I present you... THE OPTIONS MENU!

http://i.imgur.com/3ejZqgV.png

Options are saved correctly. Still I need to make Bindings screen (another state) though.

Anyway, does any of you who worked with Allegro.pas have idea how to translate key number (as in al_key array) into name of it (in string)?
//edit: Dun, dun dun dun, dun dun do, dun dun dun duun. It's a tune from SML that plays in options menu.

Darkhog
05-07-2013, 11:38 AM
Hm... It's been some time, but I've started to work on game again. Had to break my laziness.

Anyway now I'll implement TGameState class. I also need to do some more engine stuff (I cannot believe I didn't implement TGameObject class! I also need to implement some list stuff for sprites, animated sprites and then game objects (design and most of code based on TObjectList)).

Darkhog
10-07-2013, 01:31 AM
Aaaaand SHL has now public Github repo: https://github.com/darkhog/SuperHeliLand! You are free to browse my TheDailyWTF-worthy code (though I'm trying to keep it clean) to your heart's content and you can even help me!

SilverWarior
10-07-2013, 07:17 AM
Good work on your project.

Darkhog
10-07-2013, 01:15 PM
I don't quite understand what you meaning, but thanks!

SilverWarior
10-07-2013, 03:30 PM
I just wanted to pay you a compliment on your work.
Now when I read back my post I have no idea why I wrote it the way I did ???

Darkhog
10-07-2013, 04:42 PM
q[uote]I just wanted to pay you a compliment on your work.
Now when I read back my post I have no idea why I wrote it the way I did ???[/quote]

Ah.

Darkhog
18-07-2013, 12:53 PM
Ok, game objects are done. There's bug that causes crash when two GOs collide, but it's being worked on.

Hopefully I'll be able to start implementing actual gameplay by next week.