• entries
7
52
• views
22127

# !) Our dear paper events

1136 views

Hi, long time no see. Two months and a half since last entry...

I've been working a lot on this little thing but for some reason I feel that I haven't made much progress, and by "for some reason" I mean that I got a new computer so I have been playing a lot games instead of working more on this.

I'm still stuck on the first mission of my game, although I made quick prototypes of the next three missions; by "prototypes" I just mean the overall structure of the mission, like what objectives will have, the order on which they will be completed, etc, but almost no dialogue, no backgrounds, few enemies (only the ones related to the objectives) and so on.

I'm liking the prototypes so far, each mission is slightly different, so they are not just like "go here and destroy this". For instance, one mission involves disabling a wind farm by hacking three terminals located on different parts of the map; each terminal hacked makes the windmills run faster, and you need to navigate the map avoiding them.

I actually made a hacking minigame, because why not? It looks like this:

You need to navigate the firewall maze, steal all the data and head to the exit; if you touch a firewall or the time is up, you are done. At its core the game is still just a shooter, but I wanted to spice things up a little bit with silly things like that.

Anyway, I'm here because I wanted to ramble about inconsequential things.

When I was a kid, I played the crap out of Age of Empires 2, which I'm sure some of you have played. That game had a fantastic level editor, I loved it, it was the first game I played that offered me the chance to make things up. I made silly, ugly and unbalanced maps, but they were MINE. I felt powerful, I felt like a GOD!

The editor had a lot of menus: one to place stuff on the map, other to manage the players and so on, but there was one menu that I had no clue for what it was: the "Triggers" menu. I mostly ignored that menu for years, I mean, I could make my maps perfectly fine without using that, but curiosity got the better of me: what were "triggers", exactly?

I started playing around. That menu offered to create "triggers" and associate them with two things: "conditions" and "effects". The game offered a huge list of them, but I had no idea what they were. After playing around, it clicked: if a condition is met, the effect happens. So simple, so powerful. In hindsight, yeah, it seems pretty obvious, but back then I honestly had no idea what they meant.

I started making silly things, like if you destroy a certain building (the condition), some enemies spawn (the effect), but then I made much more complex stuff, like heavily scripted levels with multiple winning conditions. Hell, I remember trying to make an RPG-like level on which you just control a single unit, your hero, and you have a huge map to explore, with multiples cities, some of which are blocked and you need to perform tasks to gain entry. You had a quest log of sorts, and most quests gave you gold, which you could spend to increase your HP and Damage by moving your hero next to a shop, all of this using triggers.

I felt like a god of gods.

When I wrote my map editor two years ago or so (which I'm using to make this game... and my several other failed attempts), AoE 2's editor was my main inspiration. My editor is practically the same, and that includes the triggers system (which I called "events").

An "Event" is a group of "Conditions" and a group of "Effects", plus some other data like a name (for reference) and "Requisites" (a list of event names, telling that those events need to finish before this event can be activated).

So, let's say that we have the following event:
.- Name: "Find the first base"- Conditions: - ObjectInZone(Player, Base1)- Effects: - SpawnObject(EnemyHelicopter, Base1) - SpawnObject(EnemyTank, Base1) - Dialogue("Good, you found the base. Now destroy it!")
.
This event is written manually on a text file. The event handler will read this when the game starts and will check if the conditions are met every second or so, and if all the conditions are met, it will do all its effects and then the event will be marked as "finished".

In this case, the handler will check if the player is in the zone called "Base1". If that's the case, it will spawn two enemies in that zone and a dialogue box will appear telling you what to do.

Let's consider another event:
.- Name: "Destroy the resistance"- Requisites: - "Find the first base"- Conditions: - ObjectKilled(EnemyHelicopter) - ObjectKilled(EnemyTank)- Effects: - AddHealth(100) - Dialogue("Nice, your enemy crushing skills are magically healing you for some reason")
.
Unlike the previous event this one has requisites, so it won't be active (that is, the handler won't check its conditions) until all its requisites are finished. In other words, finishing the previous event will activate this one.

So, what happens when taking both events into account is this: you go to the first base and two enemies will spawn and a little dialogue box will pop up telling you to destroy everything. After destroying the poor helicopter and tank, another dialogue box will pop up congratulating you and you'll get healed (even if that doesn't make the least amount of sense).

That's the events in a nutshell. Each level that I'm making has A LOT of events, so I have full control of the dialogue, the enemies, the objectives that you need to do to complete the mission and so on. It works great, although it's a little tedious I'll admit, but I don't know better alternatives so I'll just stick with this for now.

The events is part of the reason it's taking me so long to make this game despite the levels being pretty short, but being honest, the main reason is simply because I'm a slow worker and I tend to change a lot of things just for the heck of it: move this building a little further because it's too close to this other building; change the timing of this line of dialogue because it's a little fast; make the map slightly bigger; realise that I moved that building way too much so now I move it back to where it was, you know, small silly details like that, which is extremely time consuming and doesn't really add much, but I'll be damned if I don't enjoy placing things around in the editor.

Anyway, I also have a dialogue system, yay! This was actually a leftover from previous projects, but I tweaked the code a little bit. Now It looks like this:

Basically just big bubbles of text. The color and the position represent which one of the three characters is talking. Hopefully the dialogue is not distracting while you are shooting at things; I'm trying my best to avoid showing dialogue in the middle of the action.

I have a really weird bug, though. The dialogue bubbles are made by several small sprites that are together, and it works for the most part, but sometimes some pieces are in incorrect positions:

This is extremely rare, it only happens with certain dialogue (but not always) and it only happens if you shoot while said dialogue is up (that is, the bubble is perfectly fine but as soon as you shoot, those two pieces are moved to an incorrect position). This is driving me crazy, because unlike most bugs that I have encountered so far, I can't reproduce this one, it happens at random, and like I said, is extremely rare.

By the way, I need music!!! I love music in games, and a silent game just feels weird to me, but unfortunately I can't make music[size=1] [1], I have never done it, and I believe this is my main roadblock when it comes to finish the game.

[size=2][1] I mean, I can't make graphics either, but at least when it comes to graphics I can make ugly assets and say they are bad on purpose to fit the theme of the game =)

I think your assets look amazing. Great job taking a weakness and turning it into a strength, they just look so damn...papery

For your weird piece placement, it sounds like either a memory mismanagement issue, or a pooling problem.

I'd consider matching the theme of the popups with the rest of your game. Maybe a post-it note or some green and white dot-matrix printer paper.

And I love the trigger system for your map editor. It's a very elegant design that I've seen used in many other level editors to great effect. It's such a powerful system. How tough was it to implement?

As for music and other audio, you can download free music from various sites and several of the licenses are "attribution" based where you just have to mention where you got the sound from. It takes quite a bit of time to find sounds that will fix your game, so if you're in a game jam, plan for this taking up about a day.

Looking good sir. I was wondering how you were coming along.

I think your assets look amazing. Great job taking a weakness and turning it into a strength, they just look so damn...papery

Haha, many thanks!

For your weird piece placement, it sounds like either a memory mismanagement issue, or a pooling problem.

It could be related to memory management. I mean, I'm using C++, but I'm not allocating anything manually using new/delete, I'm just using containers (mostly vectors) to store objects. However, some objects have pointers inside (that mostly point to stuff from that same object, like an element inside a vector to avoid searching for it every time I need it). So, whenever I add another object to the vector, the whole vector is reallocated, *probably* making the pointers inside each object point to incorrect addresses, and thus getting this strange behaviour.

Or maybe is something totally unrelated. Either way, I really need to get rid of those pointers for the reason mentioned above, I believe it's just a bad practice.

I can't reproduce the problem, that's what's driving me crazy. The bug is not a gamebreaker, though. Hell, it could be a feature...

I'd consider matching the theme of the popups with the rest of your game. Maybe a post-it note or some green and white dot-matrix printer paper.

Oh, man, I thought about that, but the thing is that the dialogue is actually from the kids playing the paper game instead of the characters inside said game, so in this case it doesn't make sense that the dialogue bubbles are, uhm... papery.

I was considering having dialogue from the characters inside the paper game, and in those cases the bubbles would have been papery, but having two layers of dialogue would have been confusing so I decided to scrap that.

And I love the trigger system for your map editor. It's a very elegant design that I've seen used in many other level editors to great effect. It's such a powerful system. How tough was it to implement?

I implemented it like two years ago or so. I don't remember it being tough to implement at all, I mean, it's just a class that reads the text file and stores the data in a vector of events, with each event having a conditions vector and a effects vector. The actual conditions and effects are just a group of strings.

Each frame a method is called that handles everything by iterating the vector of events, on which it checks each condition and if they are all true, then all the effects happen and the event is pulled out of the vector of events.

The hard part is obviously making the code for each condition and effect. The code is like this:

.

...

if (condition.name == "PlayerInZone") {

// Code that checks if the player is in the zone.

if (bla bla bla)
return true;
}

else if (condition.name == "PlayerBelowHealth") {

// Code that checks if the player is below a certain amount of health.

if (bla bla bla)
return true;
}

...

return false;


.

Most conditions and effects were really trivial to code (just a few lines), but there were a few that were a little pain in the ass.

Anyway, it's not like a wrote every condition and effect two years ago; I slowly add conditions and effects whenever I need them. Just a few days ago I wrote some to manage the hacking minigame.

But yeah, not really that complicated to be honest.

As for music and other audio, you can download free music from various sites and several of the licenses are "attribution" based where you just have to mention where you got the sound from. It takes quite a bit of time to find sounds that will fix your game, so if you're in a game jam, plan for this taking up about a day.

Thanks for the tip, I haven't really searched sounds, hopefully I'll find something that fits.

If I can't find anything, I'll guess I'll just resort to grabbing a microphone and making the sounds effects with my mouth like a little kid, but eh, I prefer to find real sounds.

Looking good sir. I was wondering how you were coming along.

Believe it or not, I come here almost everyday to read new entries, but I'm way too lazy to write something myself. I guess yesterday I was in the right mood.

Many thanks for the interest

I reeaaally need to learn how to make shorter replies...

In keeping with the papery look, how about hand-lettered fonts? :D

I dunno what your rendering pipeline is but this combo works for me in C++/OpenGL:

http://fbksoft.com/easy-angelcode-generation-from-existing-bitmaps/

https://github.com/akrinke/Font-Stash/

Music.. what sound/feel/genre are you looking for? There's tons of it on soundcloud etc... game-oriented stuff can be hard to find but there are lots of game music composers hanging out in facebook gamedev groups, rpgcodex workshop forum, maybe gdnet forums, maybe linuxmusicians, kvraudio forums for sure...

I make a little music myself. Too busy programming to do anything too ambitious, but once in a while I get lucky. This - https://soundcloud.com/tnovelli/castle-music-revel-immortal - only took an hour. It's simple and sloppy but it works :D

DIY sound effects can take hours and hours to nail down (lots of editing and layering too)... and you need a decent studio mic (condenser or ribbon type, \$100 & up)... but IMHO it's fun as hell.

In keeping with the papery look, how about hand-lettered fonts?

I dunno what your rendering pipeline is but this combo works for me in C++/OpenGL:

http://fbksoft.com/easy-angelcode-generation-from-existing-bitmaps/

https://github.com/akrinke/Font-Stash/

Oooh, interesting. I was thinking about using handwriting for the menus and such, but I haven't looked much about it.

Music.. what sound/feel/genre are you looking for?

I'm open to any style of music, but considering that the game is a dumb, fast paced shooter, I think some fast and catchy music would fit really well.

I'm thinking of just using short beats (five seconds or so) in a loop, but making them change depending of the situation using events; if you are at low health the beats are louder and faster but if you are safe the beats are more slow, I don't know.

https://soundcloud.com/tnovelli/castle-music-revel-immortal - only took an hour. It's simple and sloppy but it works

That's bloody impressive, good job!

I always wanted to learn how to make music myself, but unfortunately I don't know how to start. Can you recommend me any tools to start practicing? Digital, I mean; I don't think I'm ready to just pick and learn an instrument yet, haha.

Thanks!

Check out LMMS (it's not just for Linux). For your loop idea you could put something together in Audacity (or any multitrack sound editor). Combine a bass drum and a bass (guitar or synth), say... trim it and fade out if it's too long... save it as a WAV file. Load it in your game as a sound effect, trigger it every X milliseconds, speeding up is health drops. You could have a looping guitar riff (or whatever) that turns off when the beat speeds up... and replace it with a single note (or chord) that works at different speeds... like the screechy violin in Psycho for example (but don't do that, lol)

Many thanks for the suggestions, I'll start playing with LMMS soon (hopefully today). :D

I have used music in this game before (not made by me, just music from random games), so I already written a music handler class that loads the music files (.ogg format), and I also have written "effects" to control the music handler (stop the music, add music to queue, set a loop, etc).

The handler only plays one file at a time, though, so I can't play a bass sound and then, if the health drops, add a guitar sound on top. I think I'll just have different files, like one with a slow guitar, another with fast guitar, another with fast guitar and bass, and play them one at a time. The handler already fades the sounds in and out when a file is changed, so that's one less thing to worry about.

Again, many thanks for the suggestions, I didn't know about LMMS. I'm familiar with Audacity, though ;)

Cheers!

## Create an account

Register a new account