shmup source code?

A place for people with an interest in developing new shmups.
Post Reply
Emperor
Posts: 5
Joined: Wed Apr 25, 2007 3:10 pm

shmup source code?

Post by Emperor »

Hey guys first off let me just say great site, I've been a huge fan of shmups since I was three years old and beat 1942 on my NES. I'm a junior in college majoring in computer science specifically in software programming. My goal is to become a game programmer, and right now I'm getting ready to create my very first (serious) game. Yes, it's going to be a shmup :D I'm 100% serious about making this game and I plan on making it a full-scale shmup with at least 30 levels.

I have a few questions that I've numbered for easy answering, if anyone can help me I'd greatly appreciate it:

1. Where (if anywhere) can I find source code(preferably in C++ or java) for a shmup on the web?

2. Is there any high quality pre-built game engines/level editors for shmups?

3. Can anyone here who's personally worked on a shmup give any advice?

Thank you very much to anyone who helps and I look forward to working with you to make one kick ass shmup :)
www.gameinfinite.com - your source for all your gaming needs!

www.top200.org - connecting YOU to the best sites on the 'net!
User avatar
mrkotfw
Posts: 170
Joined: Sun Nov 26, 2006 3:15 am
Location: California

Post by mrkotfw »

First, choose a platform. If on PC, I guess SDL should do. If you're choosing a console, write all the code yourself. Don't rely on other people's code! I would choose a simple platform first that has a lot of tech docs.

Good Luck!
Yaul: An awesome open source SEGA Saturn software development kit
Emperor
Posts: 5
Joined: Wed Apr 25, 2007 3:10 pm

Post by Emperor »

I plan on writing all the code myself in C++, however I just thought it would be extremely helpful to look at the source code of a shmup to get an idea about different ways of doing things. You seem helpful, so maybe you can help me out I'm wondering about the following things:

1. How difficult is it to create a game engine for a shmup?
2. What about level editors? Do you create your own or use some premade one?
3. Do most shmups simply use a giant bitmap for the level and then have the code make the screen scroll downwards?

Thank you very much for the reply.
www.gameinfinite.com - your source for all your gaming needs!

www.top200.org - connecting YOU to the best sites on the 'net!
User avatar
mirkvid
Posts: 572
Joined: Wed Jan 26, 2005 11:41 pm
Location: las vegas NV

Post by mirkvid »

don't use one large bitmap for the background, use several small ones. try making a class BGtile. it can have a bitmap and x and y coordinates for members. now, when you can deallocate the memory when the tile goes past the bottom of the screen and you dont need it anymore. you can also set the tiles to loop like during a boss in DDP DOJ or mushi!

what are you using to draw the graphics? win32 api or d3d or open gl?
kong
Posts: 144
Joined: Wed Jan 26, 2005 4:44 am

Post by kong »

You might already know about it, but check out http://www.shmup-dev.com/ if you haven't been there yet. It's a fairly active site/forum for shmup development.
User avatar
serge
Posts: 55
Joined: Wed Mar 30, 2005 1:06 am
Location: Odessa, Ukraine

Post by serge »

Well, I worked on shmups personally (see my sig), and my advice is: 30 levels is way too many.
I understand that you're trying to focus on the technical side of things, but still, if you're really serious about this, then the first thing to do is to read the Strategy part of this forum, see how people play these games, this will answer some of the most important questions about how to design your game's core.
User avatar
the2bears
Posts: 394
Joined: Wed Jan 26, 2005 6:08 am
Location: San Carlos, CA
Contact:

Post by the2bears »

Kenta Cho includes the source code with his games, most written in "D" which you'll find syntactically very easy to read if you know C/C++/Java.

Bill
the2bears - the indie shmup blog
Emperor
Posts: 5
Joined: Wed Apr 25, 2007 3:10 pm

Post by Emperor »

the2bears wrote:Kenta Cho includes the source code with his games, most written in "D" which you'll find syntactically very easy to read if you know C/C++/Java.

Bill
Thank you very much, where can I find his games?

You all have been very helpful I really appreciate it. If you don't mind, since you guys know what you're talking about I'm gonna ask a few more questions. I know I could probably look around and come up with some answers myself but personally I rather get answers from the experts:

1. What do most shmups use as far as level editors?

2. Mirkvid, to answer your question regarding how I'm going to draw the graphics to be honest I'm not sure yet. But I know my shmup is going to be 2D possibly with some particle effects with explosions and things and sprites that appear 3D in certain ways but nothing too fancy.. what would you recommend?

3. Serge, how long do you think a medium sized shump would take to create in C++. (I'll be working on it probably 4+ hours a day 5-7 days a week).

4. Serge what did you use to program, draw the graphics and make the levels for in your shmups?

Thank you to everyone again for any help!
www.gameinfinite.com - your source for all your gaming needs!

www.top200.org - connecting YOU to the best sites on the 'net!
User avatar
serge
Posts: 55
Joined: Wed Mar 30, 2005 1:06 am
Location: Odessa, Ukraine

Post by serge »

Let me start with the second question, to provide some background first.
4. Serge what did you use to program, draw the graphics and make the levels for in your shmups?
For ClayGun approximately 80% of graphics is prerendered.
3DS MAX was used to model and render gfx and Combustion for some post-processing. We didn't choose this software, but this is what was used by the GC artist we were working with. Note that these programs are quite expensive for an individual working on a personal project.
Some graphics/anims were drawn on paper, scanned in and colored in Photoshop. This is not a good way to create in-game artwork, but we didn't have anyone capable of good pixel-art back then.

XIIZeal is a port of XIIStag, an arcade game running on PS1-like hardware (but more powerful). We did all the work to do with porting it to PocketPC - graphics code, sound code, controls, tweaks/changes to gameplay etc.
XIIStag/XIIZeal in-game graphics are almost all pre-rendered, software used is Lightwave 3D, Adobe Illustrator and Photoshop.

ClayGun core is written in C, C++ and some ARM Assembly language (ARM processors are used in most PocketPCs, phones etc.).
However, most of the gameplay code is written in a custom scripting language.

XIIZeal is 99.9% pure C, with a bit of C++ to talk to some external libs on PocketPC.

Both games use big bitmaps for backgrounds, not tiles. For ClayGun there are two bg layers, with some control codes built into the data - i.e. where to loop, where to stop. Background animations are sprites, and controlled by the scripting language.
For XIIZeal background anims were programmed in C, i.e. there are several bitmaps moved/animated by a special task in the program code.

You only really need a level editor if you're using tiled backgrounds (see ProMotion below).
Both GlayGun and XIIZeal use a system of triggers assigned to particular scroll positions, these triggers either call a script function (ClayGun) or create a new enemy task (XIIZeal) etc.
In XII-Stag/XIIZeal these are just some data arrays in code, in ClayGun level triggers contain a bit more info, and this data is stored in XML files for editing, these files are then compiled to binary format for run-time.

ClayGun uses custom gfx format, XIIZeal stores its gfx in Playstation TIM format.
In both projects there are number of helper tools, shell scripts for particular tasks etc.
Graphics conversion utils for ClayGun were written in Java, script compiler and level triggers tool were both programmed in C#. There are some custom tools to edit hitboxes, for XIIZeal some gfx tools related to its origins on PS-like hardware etc.

Screen output in both games is done via direct access to video hardware on PocketPC. Original XII-Stag uses Playstation/G-NET drawing API, the port emulates these libs, basically providing the same interface, but with my own implementation that works with video hardware directly. All actual drawing/rasterization is done in software, there is an OpenGL:ES implementation for XIIZeal but it's not fully working and unreleased (yet).

3. Serge, how long do you think a medium sized shump would take to create in C++. (I'll be working on it probably 4+ hours a day 5-7 days a week).
It depends, really.
I assume we're talking about "the first 90% of work" here.
Something that looks and plays like a shmup I think is possible to put together in several months, if working in such mode (and if you know exactly what to do on the programming side of things). And this assumes you have all the artwork you need.
To get it to playable state much more time is needed, most development time is spent in the "testing, changing, re-testing, making more changes" cycle.
It's also quite difficult to maintain motivation when working alone.
Both ClayGun and XIIZeal were side-projects for me, for ClayGun I wrote the graphics and anim core, scripting, most of the tools, designed the gameplay system and also did some of the graphics and music, and it took perhaps 2-3 months of my time.
However, afterwards 2 programmers and 2 artists were working on it for approx. a year, building actual game on that foundation, then another programmer was added and 6 more months spent on the gameplay, then some more months etc. All in all, I think it took more than 2 years (and was quite expensive).
Same with XII-Stag/XIIZeal, for the original game there was 1 programmer working on it full-time, with 3-4 artists working part-time mostly and it took approx. 2 years as well. A chunk of code came from the previous projects by the original developer, but most time was spent on the gameplay anyway. Porting took several months, internal testing several more months etc.
To summarize, to make a playable shmup quickly you need a group of experienced people ("group" and "experience" are keywords here), or be prepared to spend several years on it.
But it is possible to program a prototype-level shmup in several months, if you have some graphics to work with.

How do you plan to make graphics for your project? That is, do you plan to do it yourself or find someone to make it for you (maybe find someone on this forum)?
If I understand correctly you don't have experience with drawing, pixel-art or 3D gfx?
However, even if your goal is to become a game programmer, I think that knowing how to use gfx creation software will be really helpful.
Anyway, here are some notes about free and inexpensive software available, just in case:
Pro Motion is quite good for pixel art: http://www.cosmigo.com/promotion/index.php and it's also inexpensive. I think it's the best choice if you want to make tiled backgrounds.
GIMP (http://gimp.org) is free and can be used instead of Photoshop to some extent.
Blender (http://www.blender.org) is a complete and free 3D package, and, at least "on paper", it looks very capable. I'm not familiar with it (I myself am using Lightwave and XSI for 3D graphics), but sure enough it can be used to model and pre-render animated sprites for enemy ships and the like (e.g. explosions).
Really, if you're adventurous then try learning how to use a 3D package. Will be really helpful in the future since you're interested in game development, and there is a real chance that you can create something passable after a couple of months of intensive training (i.e. the chance is much more real than becoming good at pixel-art in that time).
User avatar
the2bears
Posts: 394
Joined: Wed Jan 26, 2005 6:08 am
Location: San Carlos, CA
Contact:

Post by the2bears »

Emperor wrote:Thank you very much, where can I find his games?
:shock:

Glad I was sitting down for that ;)

Here's the link for Kenta Cho's site: ABA Games

Bill
the2bears - the indie shmup blog
User avatar
Pixel_Outlaw
Posts: 2636
Joined: Sun Mar 26, 2006 3:27 am

Post by Pixel_Outlaw »

Wow a new post in the Development section....

All his games are good DL them all. Really he is a VERY well known developer among homebrew enthusiast.
Some of the best shmups don't actually end in a vowel.
No, this game is not Space Invaders.
Emperor
Posts: 5
Joined: Wed Apr 25, 2007 3:10 pm

Post by Emperor »

Serge thank you very much for the reply! To answer your question I'm more than likely going to get someone else to do the graphics. To be honest, I never imagined making a 2D shmup could take up to two years O_O.

Serge, for my shmup I want a significant amount of interaction with the ground/level itself. Keeping this in mind, would you recommend a tile system or would a big bitmap work just as well?

I know there's a ton of variables involved in answering this question, but if you would just give it your best shot:

If I were to make a medium sized 2D shmup with lets say ten levels and a decent amount of features and I worked on it 4+ hours a day, do you really think it would take more than a year to create if I was the only person working on it?


Finally, does anyone know of a tutorial/book that guides you step by step on either how to create a shmup or how to create a game? This would be very helpful, thanks again for all the replies guys!
www.gameinfinite.com - your source for all your gaming needs!

www.top200.org - connecting YOU to the best sites on the 'net!
User avatar
landshark
Posts: 2156
Joined: Wed Jan 26, 2005 5:27 am
Location: Chicago 'Burbs

Post by landshark »

Emperor wrote: If I were to make a medium sized 2D shmup with lets say ten levels and a decent amount of features and I worked on it 4+ hours a day, do you really think it would take more than a year to create if I was the only person working on it?
Most likely yes. Not to try and put you down, but good luck working on it for 4+ hours everyday. There is a good chance you will suffer a major burnout effect at some point. Get some other people involved with you.

Any programming project benefits from more than one (good) mind. Especially when creativity is involved.
Image
SiKrAiKeN: While I don't think everyone here -is- a Ninja Turtle, I DO believe everyone here has the potential to be a Ninja Turtle. No doubt.
User avatar
battlegorge
Posts: 67
Joined: Thu Feb 16, 2006 12:39 pm

Post by battlegorge »

Serge, your game Claygun looks great.
Why is it only for pocket pc?

Id like to know how your level triggers work! :P
I have a level editor with 3 layers for gfx,collision and static objects.
But for formations of flying enemies i use this trashy method:
if scrollpos=60 enemy1.f_create(x,y)
if scrollpos=120+multi*10
enemy2.f_create(x,y)
if multi<8 multi=multi+1 else multi=0
endif
.....

This makes it hard to change something. How did you do it?

Emperor, if you want interaction with the ground, i suggest using tiles.
But you can also make an editor that loads the large backgrounds and paste collision tiles over it.
Heres a little programming practice i made:
http://www.savefile.com/files/687244

Its only a spaceship with blaster, laser and crazy missiles.
And a level editor.
A=speed; S=shoot
Its Blitzmax Source, the newest Blitzbasic version.
User avatar
serge
Posts: 55
Joined: Wed Mar 30, 2005 1:06 am
Location: Odessa, Ukraine

Post by serge »

Yeah, what landshark says.
But this is really not to discourage you, but rather to put things into perspective.

For bg interactions it's better to approach this like with most other types of games - there is a display model, and another invisible collision model.
So the way you store your diplay gfx is not all that important actually.
But indeed, with tiles-based system it's probably easier to understand at first.
In fact some earlier versions of ClayGun had some bg interactions, but this idea was dropped later.

battlegorge, thanks!
ClayGun was created as a PocketPC game, and to a certain degree was optimized for stylus-based controls. It wasn't really planned to release it on any other platform.
However, there is a PC version (with reprogrammed controls/gamepad support), and it most likely will be released, but only in Japan (by INH) and in very limited quantities.

As for the triggers - it's really simple. Yes, it's tied to the scroll pos.
But it's not in the code, instead it's stored in a binary datafile where each record has approximately the following structure:
scroll_pos;
number_of_triggers;
script_functions[number_of_triggers];
So basically all the "script_functions" will be called for the current "scroll_pos".
User avatar
pixelcorps
Posts: 797
Joined: Wed Jan 26, 2005 12:52 am
Location: JP

Post by pixelcorps »

could you explain more about the INH deal? PM if necessary.

thanks.
Emperor
Posts: 5
Joined: Wed Apr 25, 2007 3:10 pm

Post by Emperor »

Well thank you very much guys, I'm sure I'll have more questions down the road but that's it for now. I will definitely give you all big thanks in the credits :) When I actually start making some serious progress on the game I'll give you guys some updates!

Oh wait one more question, is there any way to play Ikaruga on the PC? Everyone tells me how amazing that game is but I can't find a damn dreamcast.
www.gameinfinite.com - your source for all your gaming needs!

www.top200.org - connecting YOU to the best sites on the 'net!
User avatar
Never_Scurred
Posts: 1800
Joined: Thu May 18, 2006 1:09 am
Location: St. Louis, MO

Post by Never_Scurred »

Emperor wrote:Well thank you very much guys, I'm sure I'll have more questions down the road but that's it for now. I will definitely give you all big thanks in the credits :) When I actually start making some serious progress on the game I'll give you guys some updates!

Oh wait one more question, is there any way to play Ikaruga on the PC? Everyone tells me how amazing that game is but I can't find a damn dreamcast.
Ebay?
"It's a joke how the Xbox platform has caught shit for years for only having shooters, but now it's taken on an entirely different meaning."-somebody on NeoGAF
Watch me make Ketsui my bitch.
Post Reply