• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 10:53
CEST 16:53
KST 23:53
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
BGE Stara Zagora 2025: Info & Preview27Code S RO12 Preview: GuMiho, Bunny, SHIN, ByuN3The Memories We Share - Facing the Final(?) GSL47Code S RO12 Preview: Cure, Zoun, Solar, Creator4[ASL19] Finals Preview: Daunting Task30
Community News
Weekly Cups (June 2-8): herO doubles down1[BSL20] ProLeague: Bracket Stage & Dates9GSL Ro4 and Finals moved to Sunday June 15th13Weekly Cups (May 27-June 1): ByuN goes back-to-back0EWC 2025 Regional Qualifier Results26
StarCraft 2
General
Jim claims he and Firefly were involved in match-fixing The SCII GOAT: A statistical Evaluation StarCraft 1 & 2 Added to Xbox Game Pass CN community: Firefly accused of suspicious activities How does the number of casters affect your enjoyment of esports?
Tourneys
Sea Duckling Open (Global, Bronze-Diamond) Bellum Gens Elite: Stara Zagora 2025 $3,500 WardiTV European League 2025 Sparkling Tuna Cup - Weekly Open Tournament SOOPer7s Showmatches 2025
Strategy
[G] Darkgrid Layout Simple Questions Simple Answers [G] PvT Cheese: 13 Gate Proxy Robo
Custom Maps
[UMS] Zillion Zerglings
External Content
Mutation # 477 Slow and Steady Mutation # 476 Charnel House Mutation # 475 Hard Target Mutation # 474 Futile Resistance
Brood War
General
BGH auto balance -> http://bghmmr.eu/ FlaSh Witnesses SCV Pull Off the Impossible vs Shu BW General Discussion StarCraft & BroodWar Campaign Speedrun Quest Will foreigners ever be able to challenge Koreans?
Tourneys
[ASL19] Grand Finals NA Team League 6/8/2025 [Megathread] Daily Proleagues [BSL20] ProLeague Bracket Stage - Day 2
Strategy
I am doing this better than progamers do. [G] How to get started on ladder as a new Z player
Other Games
General Games
Stormgate/Frost Giant Megathread What do you want from future RTS games? Armies of Exigo - YesYes? Nintendo Switch Thread Path of Exile
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
LiquidLegends to reintegrate into TL.net
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread Vanilla Mini Mafia
Community
General
US Politics Mega-thread Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread Vape Nation Thread European Politico-economics QA Mega-thread
Fan Clubs
Maru Fan Club Serral Fan Club
Media & Entertainment
Korean Music Discussion [Manga] One Piece
Sports
2024 - 2025 Football Thread Formula 1 Discussion NHL Playoffs 2024
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List
Blogs
A Better Routine For Progame…
TrAiDoS
StarCraft improvement
iopq
Heero Yuy & the Tax…
KrillinFromwales
I was completely wrong ab…
jameswatts
Need Your Help/Advice
Glider
Trip to the Zoo
micronesia
Customize Sidebar...

Website Feedback

Closed Threads



Active: 33473 users

Adventures in Game Programming

Blogs > Logo
Post a Reply
Logo
Profile Blog Joined April 2010
United States7542 Posts
Last Edited: 2013-01-03 06:55:08
January 03 2013 06:52 GMT
#1
Inspired by the great video game primer written by Cecil I thought I'd share some of my experiences with hobbyist game programming. This isn't an instructional manual on how to program games or a large project, but hopefully it will give some insight. This first entry may be a little dry as I introduce what I'm going to be working on, if so you have my apologies. In terms of technical know-how this blog is going to assume you understand some basic programming techniques now and then, but even if you don't you should still be able to follow along.

Introduction

So first things first, who am I and what are my qualifications? Well, I'm a programmer (not a progamer), but not one in the game's industry. I've been programming side project games on and off for quite a while now and have really started to invest a fair bit of time into it. With my most recent project I thought it might be fun to also talk about different aspects of what I'm working on.

I hope to write a few blogs in this series and in each entry I want to dig into a different aspect of my game and all the little tricks and tips I've used to make it play well. I am by no means an expert, nor do I mean to imply things I say are the only way to do things, it's simply the way I've picked and why.

Choosing the Right Project


The game I'm going to be talking about was intentionally kept very straightforward and very small in scope. As anyone who's started a programming project will tell you, your biggest enemy is aiming too high. In this case I've decided to make a retro platformer in the style of Castlevania and Ghost & Goblins. Sure platformers are a dime a dozen, but I'm OK with that; I'm making it for myself, not to become the next Notch or Pixel. Given that I have my full time job and art takes me an extremely long amount of time to product (more on that later), I thought a simpler project that I can finish in a reasonable amount of time would be great.

It's amazingly easy to take simple ideas and get them bogged down in that one hard part everything relies on. Even worse, with more experimental game ideas you can easily get stuck with a prototype that just isn't fun.

[image loading]
A pretty far along prototype. I really like the setup for this game, but I had trouble designing content and explaining the concept to people. Essentially it's a game about time travel where the player character travels back in time, but you go through everything in chronological order. It is functional, but it doesn't have anything that really makes it stick as a game. Art is placeholder art from Biolab disaster


Even if the game is fun, you can really get stuck on implementation details, the simpler you can keep your first few projects, the better off you are going to be. Platformers are great in this regard. Your enemy AI is going to be very simplistic, you often don't even need a true pathfinding algorithm, and you can get by with much simpler collision detection. Don't mistake that for thinking platformers are simplistic or straightforward, there's a world of difference between Bubsy and games like Super Meat Boy.


[image loading]
This is another prototype I really like. A tactical battle RPG type thing. The concept sounds simple, but a tactical RPG demands strong AI which started to become a huge time sink. I decided with this one to shelve it for the time being. Plus I need to go back and implement fog of war to make the game fun. It does have a nice A* implemented I may talk about at some point.


The Tech

So now that I've decided on my project, the next step is deciding what tech to use. Normally this is where you may debate the differences between C++, C#/XNA, or countless other languages, but my case is different. I've been working a lot lately with a nice HTML5 engine called ImpactJS, so I'll be using that. Javascript isn't really a language I'd recommend to new programmers, nor would I say it's a particularly good environment for game development. The reason I choose it is simple: my work has recently required me to start doing some javascript programming and I wanted to get more comfortable with it. In that respect ImpactJS has been great for me, it has taken some of the load off what I need to program for my game, and I feel very comfortable in javascript now.

When you use a pre-built engine its functionality can range from incredibly basic to pretty robust. In the case of ImpactJS I get quite a lot, it has a built in level editor, collision detection algorithms, decent animation & font support, asset management, input handling, and a structured game loop that I can just plug into. The engine also exposes object oriented functionality and module support for javascript which is handy. It's far from perfect, and as you'll see using such a robust system can have a lot of limitations, but it works and that's what matters. There is also one kicker that makes me feel good about using it: being javascript the code is exposed for modification.

So now that I have my engine it's time to get started...

Screens & Overlays


Right out of the gate I decide to tackle the issue of screens first. A lot of the time this is something you may put off until after having a working prototype, but in this case I know I'm going full steam ahead so there's no sense in delaying it. In cases where I do try to tackle the issue later on, it's much more of a pain to retrofit than to do it up front.

So what is the screen problem? Well quite simply, the highest level state machine for my system. Pretty much every game is going to have at least two states: the menu/start screen and the game screen. Being able to switch between the different screens without issue isn't terribly difficult, but I do need to have something there.

For my simple platformer I can break the screens down into the following short list:

  • Starting Menu Screen
  • Option Menu Screen
  • Game Screen
  • Credits/Ending Screen


Next I come up with what I need the screens to do:
  • Render
  • Run logic/frame (update)
  • Initialize the screen
  • Uninitialize the screen to remove key bindings and such.
  • Animate transitions between screens.


I punt on that last one for now. With such a limited # of transitions I don't need a system in place for transition animations, I can handle that on a case by case basis.

So now it's time to hash out a quick interface that's going to give me what I need. Being javascript, I don't formalize it as an interface, there's not enough logic for that to be necessary. A simple set of functions for each implemented screen will do: initialize, destroy, draw, and update. Each screen initializes the key bindings it needs in initialize, removes them in destroy, and uses draw & update to render the screen and update its state. I add a global method to allow screens to tell the system to load another screen. It's not an idealistic architecture, but it's functional and gets the job done.

The next step is implementing what I call overlays. In this case my overlays are going to be the pause menu and any other information that appears over a screen rather than as a screen. Overlays are very compact as well, they have an identical interface to a screen with one notable difference. Instead of using a global function to close itself, I take advantage of one of the best parts of javascript: functions are treated like objects. That means the object creating the overlay can pass the overlay the function to close itself. No need for a more complicated event handling system or other mechanism. When the overlay is ready to be closed it just calls its own function and it's all taken care of.

[image loading]
Here you can see the game screen with an overlay indicating that the player has died and the can restart. You might thing the sprite died from an enemy, but it's really just from embarrassment over how he looks.


Now that I've whipped up my starting screens and overlays I'm ready to focus almost exclusively on the game itself. At this point my structure is as follows:

  • A main game loop provided by the engine.
  • A menu screen with options for New Game, Continue (not functional), and Option Menu
  • An option menu with options for volume control.
  • A game screen.
  • A menu overlay for the game screen with support for pausing the game.
  • A death notification for the game screen with support for retrying. I won't be using lives for this game.


Conclusion (for now)

Not bad for the first few hours of programming. As you may guess by the last screenshot, I have a little more done at this point, but I'm going to end this blog here. Next time I hope to get into the camera as well as some basic enemy stuff like how I made my "medusa heads".

If you've read this far, thank you! I know menus and overlays aren't the most exciting part of game development, nor was this description particularly involved, but I wanted to get it out of the way first. Next time I will be providing more code examples and specific algorithms. If you are so inclined I'd appreciated any feedback on how to improve this blog or topics you'd like to hear about.

*****
Logo
memcpy
Profile Blog Joined April 2010
United States459 Posts
January 03 2013 09:17 GMT
#2
Great approach. Start small, prototype quickly, move on from there. If you come up with anything interesting you should consider posting it for early playtesting. Good luck!
Chezus
Profile Joined January 2011
Netherlands427 Posts
January 03 2013 15:22 GMT
#3
I love reading blogs like this... Hobbyist projects are the best. I'm currently in my second year as a Game Technology student, and I've noticed that projects that I'm "forced" to work on, I enjoy far less. I don't know, I guess there's just something liberating about them.
If you require some game design feedback, let me know. I'd love to playtest some time.

Right, enough procrastinating, back to work I guess. Gl hf with your project!
Logo
Profile Blog Joined April 2010
United States7542 Posts
Last Edited: 2013-01-04 21:06:50
January 04 2013 21:05 GMT
#4
Thanks guys! I hope to get something up for people to play around with as soon as I can. A lot of that is going to depend on how well I get through the art. For a lot of games you can get away with crappy art, but for a platformer it's really important to have good kinaesthetics at the very least. So until I nail down things like the walking animation the game just won't 'feel' fun, but that's a topic for another blog!
Logo
CecilSunkure
Profile Blog Joined May 2010
United States2829 Posts
January 04 2013 21:19 GMT
#5
Hey I really enjoyed this blog! So about how much time do you think you've spent on the various prototypes you have? Here are my favorite pixel art tutorials, maybe they can be helpful to you too.

Would be very cool to be able to play some of these. They are all in HTML5 right? So we can just play them in our web browsers?
Logo
Profile Blog Joined April 2010
United States7542 Posts
January 05 2013 03:44 GMT
#6
Yep, all the ones I showed are HTML5 so they run in a web browser. The first one, I don't think I can distribute without redoing most of the art (it's placeholder art that I took from the demo source included with the engine I'm using). I'll look into finding somewhere to toss the RPGish one.

If I count all prototypes across all technologies I've written... well I have no idea! Probably somewhere between like 200 and 300 hours (so a pretty wide spread). In terms of the HTML 5 stuff, with that I tend to blow through the prototyping stuff pretty quickly so maybe I've spent like 50 hours across the 4-5 prototypes I've written. The bulk of that was writing a piece for one game to get an entity to follow a mouse drawn curved path at a velocity that is dependent on the amount of curvature in the path (while also smoothing said path of minor bumps and wiggles). When I finished that is when I decided I needed a break to do something relatively simple before continuing on.
Logo
Please log in or register to reply.
Live Events Refresh
WardiTV Invitational
11:00
WardiTV June Groups A & 1/2C
Harstem vs PercivalLIVE!
Krystianer vs MaxPax
YoungYakov vs Spirit
Krystianer vs YoungYakov
WardiTV1165
IndyStarCraft 193
Rex166
LiquipediaDiscussion
Replay Cast
10:00
StarCraft Evolution League #13
CranKy Ducklings106
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Harstem 304
IndyStarCraft 193
Rex 166
ProTech84
Vindicta 39
StarCraft: Brood War
Britney 27215
Sea 6418
EffOrt 1244
Stork 600
Larva 402
Light 384
Mini 377
ggaemo 372
Snow 338
actioN 283
[ Show more ]
ZerO 215
BeSt 210
Nal_rA 123
Pusan 85
sSak 79
Mong 71
Sharp 58
Hyun 56
Sea.KH 56
sas.Sziky 52
GoRush 49
Movie 45
Sacsri 41
Aegong 25
Backho 17
Terrorterran 15
Trikslyr14
Shine 14
yabsab 10
Dota 2
Gorgc9425
XcaliburYe644
syndereN428
Counter-Strike
olofmeister1102
fl0m816
Stewie2K614
Foxcn543
byalli281
edward108
Heroes of the Storm
Khaldor75
Other Games
singsing1935
B2W.Neo1417
DeMusliM406
Lowko290
crisheroes246
XaKoH 190
ArmadaUGS173
Mew2King118
KnowMe58
QueenE54
ZerO(Twitch)16
Organizations
StarCraft: Brood War
UltimateBattle 1740
Other Games
BasetradeTV29
StarCraft: Brood War
Kim Chul Min (afreeca) 9
lovetv 9
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 15 non-featured ]
StarCraft 2
• poizon28 22
• intothetv
• AfreecaTV YouTube
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• C_a_k_e 3659
League of Legends
• Nemesis11009
• Jankos1850
• TFBlade1078
Upcoming Events
PiGosaur Monday
9h 7m
GSL Code S
18h 37m
Rogue vs GuMiho
Maru vs Solar
Online Event
1d 9h
Replay Cast
1d 11h
GSL Code S
1d 18h
herO vs Zoun
Classic vs Bunny
The PondCast
1d 19h
Replay Cast
2 days
WardiTV Invitational
2 days
OSC
2 days
Korean StarCraft League
3 days
[ Show More ]
CranKy Ducklings
3 days
WardiTV Invitational
3 days
Cheesadelphia
4 days
CSO Cup
4 days
GSL Code S
4 days
Sparkling Tuna Cup
4 days
Replay Cast
5 days
Wardi Open
5 days
Replay Cast
6 days
Replay Cast
6 days
RSL Revival
6 days
Cure vs Percival
ByuN vs Spirit
Liquipedia Results

Completed

CSL Season 17: Qualifier 2
BGE Stara Zagora 2025
Heroes 10 EU

Ongoing

JPL Season 2
BSL 2v2 Season 3
BSL Season 20
KCM Race Survival 2025 Season 2
NPSL S3
Rose Open S1
CSL 17: 2025 SUMMER
2025 GSL S2
BLAST.tv Austin Major 2025
ESL Impact League Season 7
IEM Dallas 2025
PGL Astana 2025
Asian Champions League '25
BLAST Rivals Spring 2025
MESA Nomadic Masters
CCT Season 2 Global Finals
IEM Melbourne 2025
YaLLa Compass Qatar 2025
PGL Bucharest 2025
BLAST Open Spring 2025

Upcoming

Copa Latinoamericana 4
CSLPRO Last Chance 2025
CSLPRO Chat StarLAN 3
K-Championship
SEL Season 2 Championship
Esports World Cup 2025
HSC XXVII
Championship of Russia 2025
Murky Cup #2
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025
FISSURE Playground #1
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2025 TLnet. All Rights Reserved.