| 1 |
/////////////////////////////////////////////// |
| 2 |
// |
| 3 |
// Snipe2d ludum dare 48h compo entry |
| 4 |
// |
| 5 |
// Jari Komppa aka Sol |
| 6 |
// http://iki.fi/sol |
| 7 |
// |
| 8 |
/////////////////////////////////////////////// |
| 9 |
// License |
| 10 |
/////////////////////////////////////////////// |
| 11 |
// |
| 12 |
// This software is provided 'as-is', without any express or implied |
| 13 |
// warranty. In no event will the authors be held liable for any damages |
| 14 |
// arising from the use of this software. |
| 15 |
// |
| 16 |
// Permission is granted to anyone to use this software for any purpose, |
| 17 |
// including commercial applications, and to alter it and redistribute it |
| 18 |
// freely, subject to the following restrictions: |
| 19 |
// |
| 20 |
// 1. The origin of this software must not be misrepresented; you must not |
| 21 |
// claim that you wrote the original software. If you use this software |
| 22 |
// in a product, an acknowledgment in the product documentation would be |
| 23 |
// appreciated but is not required. |
| 24 |
// 2. Altered source versions must be plainly marked as such, and must not be |
| 25 |
// misrepresented as being the original software. |
| 26 |
// 3. This notice may not be removed or altered from any source distribution. |
| 27 |
// |
| 28 |
// (eg. same as ZLIB license) |
| 29 |
// |
| 30 |
/////////////////////////////////////////////// |
| 31 |
// |
| 32 |
// Houses are taken from a satellite picture of glasgow. |
| 33 |
// |
| 34 |
// The sources are a mess, as I didn't even try to do anything |
| 35 |
// really organized here.. and hey, it's a 48h compo =) |
| 36 |
// |
| 37 |
|
| 38 |
Orbital Sniper |
| 39 |
|
| 40 |
Welcome to utopia. |
| 41 |
The year is 2174, and you have been ordered to function as an |
| 42 |
orbital sniper. In your world there's just three kinds of people: |
| 43 |
VIPs, dissidents and normal citizens. VIPs run the world: they must |
| 44 |
not come to harm. Dissidents must die. If a commoner or two gets |
| 45 |
wasted in progress, it'll count against you when your post ends. |
| 46 |
|
| 47 |
You were a normal citizen only moments ago. If you manage to prove |
| 48 |
yourself and keep VIPs safe in your area, they might make you |
| 49 |
a VIP. Or do poorly enough and they might decide that you're the |
| 50 |
enemy. |
| 51 |
|
| 52 |
On screen, VIPs are designated blue, threats are designated red |
| 53 |
and the normal folk are white. |
| 54 |
|
| 55 |
You control the target with mouse; right-drag or use mouse wheel |
| 56 |
to zoom. Different zoom modes are useful for different things. |
| 57 |
Zoom full out to see the whole situation at a glance (with all |
| 58 |
that useless clutter removed), or zoom full in for better aiming. |
| 59 |
Several levels of zoom in between give different information. |
| 60 |
|
| 61 |
Left click fires your gun (which is based on some new physics laws |
| 62 |
that we haven't invented yet, as the target is destroyed instantly). |
| 63 |
The gun reloads for three seconds, so make sure you hit. |
| 64 |
|
| 65 |
A typical game round lasts for about 4 minutes. It starts out easy, |
| 66 |
but gets rather nasty later on. |
| 67 |
|
| 68 |
Comments etc can be tossed my way; my current email address |
| 69 |
is [email protected], but you can find me at |
| 70 |
http://iki.fi/sol even if that changes. |
| 71 |
|
| 72 |
Cheers, |
| 73 |
|
| 74 |
Sol |
| 75 |
|
| 76 |
-- 8< -- 8< -- |
| 77 |
Version 1.20 |
| 78 |
Top view now shows connections, and otherwise gameplay has been |
| 79 |
tweaked a bit. |
| 80 |
|
| 81 |
Version 1.12 |
| 82 |
Spawn point location finder had one wrong variable.. |
| 83 |
|
| 84 |
Version 1.11 |
| 85 |
Stupid mistake made it possible to spawn several VIPs at once. |
| 86 |
|
| 87 |
Version 1.10 |
| 88 |
- Click to restart the game |
| 89 |
- Made it less probable for more than 1 VIP to stroll around |
| 90 |
- Made the game easier |
| 91 |
|
| 92 |
-- 8< -- 8< -- |
| 93 |
|
| 94 |
Build log |
| 95 |
|
| 96 |
---- |
| 97 |
Saturday |
| 98 |
---- |
| 99 |
|
| 100 |
4am |
| 101 |
contest begins |
| 102 |
|
| 103 |
10am |
| 104 |
I manage to drag myself out of bed, with a great idea of a game if it has a 'gravity' theme, and |
| 105 |
find that it's 'guardian'. Ponder upon several ideas, take a walk. |
| 106 |
|
| 107 |
11am |
| 108 |
Start drawing a city map. Set up SDL. Find out that SDL doesn't have a stretch blit. Decide |
| 109 |
to write my own. First version done, I'm hungry. |
| 110 |
|
| 111 |
12.30am |
| 112 |
Start cooking pancakes. |
| 113 |
|
| 114 |
12.40am |
| 115 |
Get the great idea to keep a log |
| 116 |
|
| 117 |
1:30pm |
| 118 |
Damn, cooking these pancakes takes a long time. |
| 119 |
|
| 120 |
2:00pm |
| 121 |
Armed with a batch of pancakes, strawberry jam and prototype zoomer, I start working on mouse control. |
| 122 |
|
| 123 |
2:10pm |
| 124 |
Mental note: buy dronningholm jam next time. |
| 125 |
|
| 126 |
3:34pm |
| 127 |
Mouse control implemented + clippings & unreal dither implemented in zoomer |
| 128 |
|
| 129 |
3:52pm |
| 130 |
fixed some bugs in unreal dither reading outside image, added crosshairs & wobble |
| 131 |
|
| 132 |
4:21pm |
| 133 |
Working on writer, found that SDL's SDL_MUSTLOCK macro doesn't work. |
| 134 |
|
| 135 |
4:39pm |
| 136 |
Blitting from one 8bit surface, changing palette, blitting again doesn't work. Have to make |
| 137 |
several copies of font.. |
| 138 |
|
| 139 |
5:15pm |
| 140 |
Split source base into several source files. |
| 141 |
|
| 142 |
6:13pm |
| 143 |
Made prototype sprite stuff |
| 144 |
|
| 145 |
6:32pm |
| 146 |
drew AI waypoint map |
| 147 |
|
| 148 |
7:00pm |
| 149 |
did tracing code for AI waypoints |
| 150 |
|
| 151 |
7:31pm |
| 152 |
posted first screenshot in ludum dare |
| 153 |
|
| 154 |
7:42pm |
| 155 |
designed AI data structure; time to cook something.. omelet, ham, potatoes. |
| 156 |
|
| 157 |
8:21pm |
| 158 |
Done eating finally, going to mix some drink and then I'll work on AI behaviors. |
| 159 |
|
| 160 |
9:53pm |
| 161 |
Pedestrian AI is somewhat finished |
| 162 |
|
| 163 |
10:02pm |
| 164 |
Did a simple shooting animation |
| 165 |
|
| 166 |
10:59pm |
| 167 |
Drew logo screen |
| 168 |
|
| 169 |
12:05am |
| 170 |
Created the game end screen |
| 171 |
|
| 172 |
---- |
| 173 |
Sunday |
| 174 |
---- |
| 175 |
|
| 176 |
1:10am |
| 177 |
Did preliminary VIP and bad guy spawns, fixed a bug in clipper with a kludge |
| 178 |
(too tired to think, really). Only real thing left before calling this |
| 179 |
a game are the VIP and bad guys' AI:s. I'm calling it a day. |
| 180 |
|
| 181 |
9:29am |
| 182 |
About 18 hours to go, I manage to drag my self up the bed again. I was wrong |
| 183 |
when I whined about the competition hours.. these are just about optimal for |
| 184 |
me. |
| 185 |
|
| 186 |
10:52am |
| 187 |
Made different zoom levels more sensible & made it so that camera wobble |
| 188 |
doesn't affect HUD stuff -> now there's a point in zooming extremely |
| 189 |
out (find VIPs and threats fast) and extremely in (actually hit someone) |
| 190 |
|
| 191 |
10:59am |
| 192 |
Added mouse wheel support (for zoom) |
| 193 |
|
| 194 |
11:03am |
| 195 |
Breakfast. |
| 196 |
|
| 197 |
12:19pm |
| 198 |
VIP and bad guys AIs done. Tweaked the target and spawn times a bit. |
| 199 |
|
| 200 |
12:38pm |
| 201 |
Added different game over reasons, fixed couple bugs. The game is now |
| 202 |
playable, about 23 hours after the first lines of code. Time to start |
| 203 |
cooking again.. |
| 204 |
|
| 205 |
2:23pm |
| 206 |
Made enough pasta sauce for a family of 4. Oh dear. Dug up my old and |
| 207 |
amazingly crappy microphone, downloaded goldwave and recorded some sounds. |
| 208 |
|
| 209 |
3:46pm |
| 210 |
Added sound. Next up is alpha blended, scaling sprite routines. Joy. |
| 211 |
|
| 212 |
4:05pm |
| 213 |
Avoiding the abovementioned task, added some stats to the game over screen. |
| 214 |
|
| 215 |
4:12pm |
| 216 |
Took a shower. |
| 217 |
|
| 218 |
5:31pm |
| 219 |
Sprites plugged in |
| 220 |
|
| 221 |
5:52pm |
| 222 |
Added screen border indicators. Time to try a release build for the first |
| 223 |
time. |
| 224 |
|
| 225 |
6:10pm |
| 226 |
Mixed some more drink, loaded the laundry machine and put it on, played |
| 227 |
around a bit with the target display. |
| 228 |
|
| 229 |
6:58pm |
| 230 |
Added target information screens |
| 231 |
|
| 232 |
7:39pm |
| 233 |
Hunting a mystery bug.. only occurs in release mode. |
| 234 |
|
| 235 |
7:50pm |
| 236 |
Hm. Using release mode + fullscreen crashed the system so totally that I |
| 237 |
lost the contents of the main cpp file at least. I have no idea how |
| 238 |
much had happened after my last backup. I at least lost sound and all the |
| 239 |
tweaking I did to the game settings. ARGH! |
| 240 |
|
| 241 |
8:09pm |
| 242 |
Since the game didn't crash anymore, I just have to hope that the crash |
| 243 |
was caused by the audio system. Oh dear. Which I'll now start to recode. |
| 244 |
|
| 245 |
8:35pm |
| 246 |
Audio re-implemented |
| 247 |
|
| 248 |
8:43pm |
| 249 |
Managed to get it to crash in fullscreen again, but not in windowed mode, |
| 250 |
and SDL happily just kills off the application without letting me debug |
| 251 |
if we're in fullscreen. Joy. |
| 252 |
|
| 253 |
9:08pm |
| 254 |
Made the fullscren mode also a software surface, doesn't seem to crash |
| 255 |
anymore. Probably a rare overflow somewhere. =( |
| 256 |
|
| 257 |
9:14pm |
| 258 |
Changed sprite drawing so that it'll draw slightly outside the screen - |
| 259 |
clipping is performed per pixel but who cares, we have CPU power.. |
| 260 |
The clipping was done earlier, so that's not the cause of the bug. |
| 261 |
|
| 262 |
9:21pm |
| 263 |
ARGH! crashed again. |
| 264 |
|
| 265 |
9:32pm |
| 266 |
Managed to crash in windowed mode: AIs were trying to use wrong waypoints |
| 267 |
in some obscure case. |
| 268 |
|
| 269 |
9:52pm |
| 270 |
Ran physics loop at 10x speed for several minutes in fullscreen release mode |
| 271 |
and nothing crashed, so I'd guess the AI stuff is fixed now. I'm fairly |
| 272 |
confident (fingers crossed) that that was it. Next up: packaging & |
| 273 |
documentation. |
| 274 |
|
| 275 |
10:15pm |
| 276 |
Finished, now I'll just zip it up and toss it away.. |
| 277 |
|