Posted by HelicopterSpy (129 posts) -

Week 2 in my journey down the rabbit hole of learning how to code has come and gone. I said in last week's blog post that I'm pretty much starting from scratch, but I feel like in this shot amount of time I've pretty much got a handle on the Lua scripting language. That's not to say, however, that I know much about actually making games.

I've plugged a few memory leaks, though they're still there, hiding. I think they should work themselves out as I take the game from starter project into an actual thing. The game started as a basic version of Galaxian that I called "Fauxlaxian" but has since spiraled wildly out of control. Instead, I'm adding a story to flesh it out. I'm much better at making a story than making a game, color me Swery.

Guess I have to stick with the name now
The story scenes also start out looking crummy but get better as you progress

The story is about a bad guy trying to make the world's most addictive video game, so while everyone's distracted playing that, he can take over the world. The problem is that he doesn't know a damn thing about making games. The hero plays the game as its being created and iterated upon, dressing down the bad guy as he goes. It's basically the story of me making the game and the characters are basically both sides of my inner monologue. It starts as just squares shooting squares and then in later levels, it adds graphics, then they get better and the game gets more complicated.

The problem is that I have really bad priority problems. I'll spend a day working on animations, then a day working on music and sounds then a few hours on story, a few hours implementing everything, etc. It's lead to the actual code within the game being a goddamned mess. The story goes through a few scenes and a few levels and then is completely broken at the moment, but if you start at a point past all that, it's fine. It's gotten to the point where it might not be a bad idea to just put what I have off to the side and just start from scratch on the code itself, I'm just hesitant to do so because I've put now 2 weeks into it.

Some things continue to stump me, like how I can't get certain text to display properly or how the hell I'm going to rein this in and ever actually finish it. I can confirm, making video games is hard. I have no idea how big teams do it. I've tried to work for at least a few hours each day, but I've lost some time to that new Code Academy thing and the 1.0.4 patch to Diablo III (More than I care to admit). I've tried adding more screen grabs, but it keeps just loading forever, maybe next week.

#1 Posted by HelicopterSpy (129 posts) -

Week 2 in my journey down the rabbit hole of learning how to code has come and gone. I said in last week's blog post that I'm pretty much starting from scratch, but I feel like in this shot amount of time I've pretty much got a handle on the Lua scripting language. That's not to say, however, that I know much about actually making games.

I've plugged a few memory leaks, though they're still there, hiding. I think they should work themselves out as I take the game from starter project into an actual thing. The game started as a basic version of Galaxian that I called "Fauxlaxian" but has since spiraled wildly out of control. Instead, I'm adding a story to flesh it out. I'm much better at making a story than making a game, color me Swery.

Guess I have to stick with the name now
The story scenes also start out looking crummy but get better as you progress

The story is about a bad guy trying to make the world's most addictive video game, so while everyone's distracted playing that, he can take over the world. The problem is that he doesn't know a damn thing about making games. The hero plays the game as its being created and iterated upon, dressing down the bad guy as he goes. It's basically the story of me making the game and the characters are basically both sides of my inner monologue. It starts as just squares shooting squares and then in later levels, it adds graphics, then they get better and the game gets more complicated.

The problem is that I have really bad priority problems. I'll spend a day working on animations, then a day working on music and sounds then a few hours on story, a few hours implementing everything, etc. It's lead to the actual code within the game being a goddamned mess. The story goes through a few scenes and a few levels and then is completely broken at the moment, but if you start at a point past all that, it's fine. It's gotten to the point where it might not be a bad idea to just put what I have off to the side and just start from scratch on the code itself, I'm just hesitant to do so because I've put now 2 weeks into it.

Some things continue to stump me, like how I can't get certain text to display properly or how the hell I'm going to rein this in and ever actually finish it. I can confirm, making video games is hard. I have no idea how big teams do it. I've tried to work for at least a few hours each day, but I've lost some time to that new Code Academy thing and the 1.0.4 patch to Diablo III (More than I care to admit). I've tried adding more screen grabs, but it keeps just loading forever, maybe next week.

#2 Posted by krazy_kyle (716 posts) -

Week 5: Give up

:P

#3 Posted by Bollard (5254 posts) -

@HelicopterSpy said:

The problem is that I have really bad priority problems. I'll spend a day working on animations, then a day working on music and sounds then a few hours on story, a few hours implementing everything, etc. It's lead to the actual code within the game being a goddamned mess. The story goes through a few scenes and a few levels and then is completely broken at the moment, but if you start at a point past all that, it's fine. It's gotten to the point where it might not be a bad idea to just put what I have off to the side and just start from scratch on the code itself, I'm just hesitant to do so because I've put now 2 weeks into it.

This seems like a problem :P I know when I was working on my first game I made sure to implement one feature at a time, to the point I was happy with it for the final vision I had for the game, and then take a whole new copy of my code and start the next feature. I even had a checklist of everything I wanted in the game and picked them one by one (admittedly in order of ease I anticipated). But in the end, doing it this way meant nothing was that hard.

Best of luck - and for the record I was working in Pygame at the time, and whilst my game struggles a little on my Raspberry Pi, it runs extremely well on most PCs because Python is nice enough to do the memory handling for ya. No memory leaks yay! (well, except when I started recursively calling my main loop, which was dumb :P)

#4 Posted by HelicopterSpy (129 posts) -

So today I decided to just start from scratch with the main code. Gonna do a lot of copy/pasting, so I should be back to where I was in no time, this isn't a full Duke Nukem style throw-everything-in-the-trash-and-start-over fest or anything. Also, I think I should put the Code Academy thing on pause because I've picked up too many bad habits from Javascript. It's disheartening, but the game will be better for it.

Also, my landlord is doing work on my roof right now. Unrelated, but it's driving me bananas.

#5 Edited by Bio2hazard (144 posts) -

Heyo !

I'm making a game too ! ( I'm making a mobile game part 3 )

I don't know if I am in a position to give advice, but, my advice is to not worry about adding dialog, sound, pretty pictures, music until way later in the development cycle. The reason for that is fairly simple: it clutters up your code with non-essential things.

My start screen looks as barren as possible, and so does my character creation screen.

I don't know if you use OOP in lua or not, but I found it great for making a game. I can simply make classes with only essential information to start out with, and then gradually add in features without much trouble.

In my experience, and I'm not saying that it necessarily applies to you, but people who tend to work on pretty background pictures, sounds, musics and everything that doesn't actually have anything to do with gameplay over, well, fleshing out the gameplay, tend to give up midway. Please don't take offense or anything, it's just that I've seen many 1-man projects where the developer is so focussed on getting the perfect start screen done, the perfect character creation and then when it comes to the gameplay trying to perfect it turns into too much of a chore and they quit.

Ideally, you want to hurry and try and get a basic version of the gameplay done first, then you can flesh out and improve the basic gameplay and then basically add more and more features ontop of it. The advantage is that you can immedeatly tell whether a feature you've added improves or reduces the actual enjoyment of the game. And it is very motivating to actually have something that you can play and call a game.

I just finished a rewrite of a major component of my game, and it was a highly frustrating process, but my game is way more stable and easier to work with now, so that's good.

So how has lua been working out in general for making a game ? I was considering using lua to store my data ( like monsters, items and so forth ) so I could code monster-specific abilities right in the monster's lua file and easilly reload it and to give modders more power, but ended up using XML instead as I know nothing about lua.

I'd love if you could get a bit more technical about how you approach obstacles and how you solve problems, as a fellow coder I am always curious how others tackle their problems.

#6 Posted by HelicopterSpy (129 posts) -

I agree that working on the actual gameplay should be priority 1, but the thing about the game is that the gameplay is fairly simple, like I said, for most of the game, it's a simple Galaxian clone. There will be a rhythm section too, but that's actually just gonna be a tweak more than an overhaul. So I burned through that in a few days, then I was totally lost on where to go next. That's actually what's led me to start over code wise. It just got to be a damn mess in there when I didn't have focus. That led me to work on visuals and sounds because I'm better at that than coding, audio especially, but it's still just placeholder stuff for the most part.

As for Lua as a language, it's purely for scripting, no objects to speak of. To that end, it's not great for storing data. That's how I'm running into problems with memory, everything is stored in tables and when those tables get cluttered, the game starts to chug. My only experience in OOP was a language called TADS (Text Adventure Development System), but that was obviously incredibly limited as it could only make text adventures. It was great for that though.

Like I said, I'm starting at pretty much zero with coding experience, so I'm not sure my problem solving is the best. It's mostly just trial and error. Most of the problems I've run up against so far though have been syntax errors, like writing "=" instead of "==" or forgetting to write "then" in my if statements. Javascript doesn't use then, and I don't think Flash's action script did either, so that's a big thing for me. Bigger problems like hit detection I've solved through a lot of staring at the screen and mental math.

Thanks for the advice though. With being so new to the whole deal, I'll take any advice. Seems like you actually know what you're doing and are making a way way more ambitious game than I am. This started as just a learning project that's spiralled out control. That tends to happen for me.

#7 Posted by Bio2hazard (144 posts) -

@HelicopterSpy:

Haha we should team up sometime. I'm a great coder but I have no artistic talent in both the audio and graphical department.

I'm somewhat amazed that you manage to make your system chug. When I worked on some 3d game stuff with openGL, I was able to make my small laptop chug but that probably was due to it's lack of a 3d accelerated card.

I'm still a bit baffled - storing data in memory is fairly normal ( hell that's what variables do ) but getting such a amount of data that the system chugs ? That sounds like something is a bit off, seeing as we number memory in the GB's these days ( unless that's just the lua way haha ). When you say tables, do you mean 2-dimensional arrays ? Actually I read up a tiny bit about it. According to this, a table is kind of a object in lua, so you pretty much seem to be working with OOP concepts already.

I just started with actionscript 3 / flex / flash builder like 3-4 weeks ago and it's been fairly easy to get into, in part because of a amazing tutorial series.

Also, I wouldn't downplay the complexity of a galaxian / space invaders game. In general, I feel there is more to games than a casual eye gives them credit for. Hit detection is a big thing, but I also feel that the general effort of setting up graphics and making things move, especially in real time is harder than most people would think, so definite props to you for getting that done!

Feel free to PM me anytime if you have any coding related questions, I'm always happy to help.