Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411196 Posts in 69314 Topics- by 58380 Members - Latest Member: feakk

March 18, 2024, 06:21:42 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityDevLogsSave the Civies - Pausable real-time tactics (Project 1, 2018)
Pages: [1] 2 3
Print
Author Topic: Save the Civies - Pausable real-time tactics (Project 1, 2018)  (Read 6789 times)
HuvaaKoodia
Level 1
*



View Profile WWW
« on: January 04, 2018, 02:42:57 PM »

The first project out of five is a go.

A single-player, pausable, real-time, tactics competition with a reactive story to boot.

Released!
Play the demo here.





Day 0 - Design stream

Here's the design stream in case you missed it.






There'll be daily posts for the 3-day prototype and then whenever something worthwhile happens. The whole project should only take 2 months so expect that progress bar to move on all snappy like.
« Last Edit: March 22, 2018, 11:40:55 AM by HuvaaKoodia » Logged
HuvaaKoodia
Level 1
*



View Profile WWW
« Reply #1 on: January 04, 2018, 02:51:07 PM »



The corruption mechanic and basic unit movement are in. The design has become more focused; might go with units mostly and few, if any, buildings. Had an idea for the setting and visuals too, but more on that later.

Using A* for pathfinding as usual. Amit explains A* much better than I would so give that a read if interested.

Something I will touch on is the architecture behind all of the above. Usually for 3 day jams I don't bother with anything fancy, but here a solid foundation is needed for future proofing.

Model-View-Controller (MVC) is my answer. The quick way of programming in Unity (or any similar engine) results in data, logic and visuals all bundled together in the same scene objects. This can be quite limiting and a hassle. With MVC the data is contained in a model database, the visuals in view objects and all (or most) logic is done via controller classes.  

In Unity models are basic C# objects (or plain arrays for data-driven programmers!); views are standard component based MonoBehaviours in the scene; and controllers are singleton classes which set up the scene, models, views and run the logic such as input.

One of the key concepts of MVS is that the views only know of the models, but cannot modify them; the models only know of themselves; and the controllers know of everything. This way the views can be removed altogether and the program still works.

Why go through all this trouble? A handful of reasons:

  • State saving. It is easy to serialize the model database into a file and deserialize it later. JSON is a good fit for this.
  • Cleaner code, even if somewhat more verbose. A trade off well worth it in a longer project.
  • Running the data and logic without the visuals. Useful for AI testing and simulations.
  • Netcode. Only sending the data over the internet. I'm not going this far in these projects, but it is good to know.

That's it for day 1. Should get into prototyping mechanics tomorrow.

Cheers
« Last Edit: March 16, 2018, 06:37:22 AM by HuvaaKoodia » Logged
HuvaaKoodia
Level 1
*



View Profile WWW
« Reply #2 on: January 05, 2018, 01:05:44 PM »


(Fixed the GIF with ffmpeg palettes. Did forget to change the Unity blue background though...)

Mechanics prototyping! Implemented four different character types.    

  • Orange "Wall". Stops corruption from overflowing and slows it down.
  • Blue "Melee". Destroys corruption at a single node. Powerful attack.
  • Green "Ranged". Can attack one node away and has a weak melee attack too.
  • Cyan "Artillery". Can attack two nodes away, but has no melee attack.

I do have other ideas too, but these are the bog-standard characters. Each character could have multiple abilities too. We'll see if that is needed.

One design choice I had to make was how many characters each node supports. At first I thought one character per node would work, but upon further pondering it resulted in ample problems. For instance swapping two characters between nodes would become needlessly complicated or require an extra command.

I'd much rather have a simple user interface and robust mechanics. So now up to four characters can reside on the same node.

Additionally wrote down some ideas for the campaign and the personalities of each character. I'd like to implement some reactivity in the campaign, not necessarily non-linearity, as in the characters saying different things based on what has happened in the past and who is still alive!

Didn't get to implementing the objective yet. Thematically it will be about rescuing "civilians" from the nodes, which mechanically equates to sending a character to a node, holding them there for a certain amount of time and defending the node.

Should do that tomorrow then, will not take too long. Would also like to put in simple graphics using the minimalistic guidelines. Unfortunately the jam itself has already ended, a bit of a mistake in the design stream, but I still dig the limitations.

Cheers
« Last Edit: March 16, 2018, 06:39:21 AM by HuvaaKoodia » Logged
HuvaaKoodia
Level 1
*



View Profile WWW
« Reply #3 on: January 06, 2018, 03:50:12 PM »



Well It did turn into an authentic jam session in the end. Stayed up for way too long. Anyways...

The prototype is finished! Didn't quite get everything in yet, but it is playable.

Try it here!  

I'll need to rest properly tomorrow, so the second design livestream is pushed to Monday. Will have it at 16.00 UTC again on Twitch, do join if at all interested. This also gives me a bit of time to add in a few more things come Monday.

Tired, but happy. This will become a proper project, no doubt about it anymore.

Cheers!
« Last Edit: March 16, 2018, 06:41:17 AM by HuvaaKoodia » Logged
HuvaaKoodia
Level 1
*



View Profile WWW
« Reply #4 on: January 08, 2018, 12:13:18 PM »



One more day for the prototype. Got animations in as well as some small tweaks here and there.

Also did the prototype showcase and scheduling stream. Have a gander:




Will reduce the amount of devlog updates from now on. Once a week at least, that's a promise!

Cheers.
« Last Edit: March 16, 2018, 06:42:23 AM by HuvaaKoodia » Logged
HuvaaKoodia
Level 1
*



View Profile WWW
« Reply #5 on: January 09, 2018, 01:16:09 PM »

Plotted out the level progression and did a bit of writing too. Realized that I'd forgotten one important set of tasks from the schedule: audio! Well, better break out that extra week already and assign it for audio implementation. As a bonus there are 10 weeks allocated for the whole project now, which makes using the progress icon even easier.

Could not think of more design or scheduling so after lunch went back to coding. Tweaked the animations and added an effect for the mage's staff. Also updated the prototype. Might as well keep doing that when there is something new to show.



Then improved the level editor workflow. Here's how it looks like now:



Drawing the wireframe and stats for the nodes is easy enough using Gizmos and Handles. Adding in a few buttons ("Remove node", "Connect nodes") was a sour reminder of the convoluted Unity editor codebase. I hadn't made any tools with it in about a year so I'd totally forgotten many key things such as SerializedObject.

Here's an example of the madness:

Code:
//This is all I want to do.
target1.connectionsUpstream.Add(target2);

//And this is how you have to do it for undo and scene saving to work!
var target1SerializedObject = new SerializedObject(target1);
var connectionsProperty = target1SerializedObject.FindProperty("connectionsUpstream");
int index = connectionsProperty.arraySize;
connectionsProperty.InsertArrayElementAtIndex(index);
var newConnection = connectionsProperty.GetArrayElementAtIndex(index);
newConnection.objectReferenceValue = target2;
target1SerializedObject.ApplyModifiedProperties();

Urgh.

That's it for today. Level design proper tomorrow. Will try to maximise the amount of decisions and/or chaos in each level.

Cheers!
« Last Edit: March 16, 2018, 06:32:06 AM by HuvaaKoodia » Logged
HuvaaKoodia
Level 1
*



View Profile WWW
« Reply #6 on: January 10, 2018, 11:09:09 AM »

Got 4 more levels done. They are all fun to play and figure out, but then again I know all the mechanics by heart now so might be too difficult for anyone else? Will need to find some testers.









Still need to pump out the tutorial levels. Might as well implement some tutorializing too while I'm at it.

Tweaked the level editor. Added a few functions, not a big deal now that I've been reacquainted with editor coding. Implemented additive level loading so that each level is in its own scene and loaded one at a time into the main scene. Used a similar system in One Final Task and it worked so well that decided to go with it again.

Hatched up a lot of small ideas throughout the day, simply wrote them down in a TODO/Ideas doc. Will consider those later when the time is right.

Cheers.
« Last Edit: March 16, 2018, 12:07:27 PM by HuvaaKoodia » Logged
danovo
Level 0
**


(Not an actual photograph)


View Profile
« Reply #7 on: January 10, 2018, 02:09:32 PM »

Not only this is an interesting concept, but the execution is clear, fast, and all-around great. The online demo already has potential to get me thinking and interested. Not a huge fan of strategy games, but this has all the elements they need to shine without any of the number-crunching hassles.  Smiley
Logged
HuvaaKoodia
Level 1
*



View Profile WWW
« Reply #8 on: January 11, 2018, 05:59:06 AM »

Not only this is an interesting concept, but the execution is clear, fast, and all-around great. The online demo already has potential to get me thinking and interested. Not a huge fan of strategy games, but this has all the elements they need to shine without any of the number-crunching hassles.  Smiley

Thanks! I'll try to keep the mechanics and UI as simple and clean as possible. Not enough time for complexity; it helps to have a deadline.
Logged
HuvaaKoodia
Level 1
*



View Profile WWW
« Reply #9 on: January 12, 2018, 09:13:41 AM »



Spent yesterday and today on the tutorials. 4 characters, 4 levels; makes sense? That's what I ended up with anyways. There's still one mechanic I might add later, so will incorporate that to the third level if it turns out to be a needed.

Added the tutorials and two more levels to the prototype.
Give it a go?

Not a lot more to show. Tweaks and fixes as well as some refactoring. The main controller had grown to five hundred lines of code already so moved the input parts of it into a new controller and the level loading parts into a new script, respectively called InputController and LevelLoader. That's fool proof naming conventions for you.

20% of the project over already. Initial graphics are next, this is where things start getting tricky!

Cheers.
« Last Edit: March 16, 2018, 12:08:17 PM by HuvaaKoodia » Logged
HuvaaKoodia
Level 1
*



View Profile WWW
« Reply #10 on: January 16, 2018, 12:42:30 PM »



Had to take care of a few RL things in the past two days, but did manage to put in enough hours to kickstart the graphics implementation, codewise at least.


The visuals are not there yet. More animations and detail are needed. Luckily there are still three full days to hone the assets, animations especially. I'm more than ok going with flat shaded graphics yet I do need to think of something for the background.


Cheers.
« Last Edit: March 16, 2018, 12:08:54 PM by HuvaaKoodia » Logged
HuvaaKoodia
Level 1
*



View Profile WWW
« Reply #11 on: January 17, 2018, 10:14:06 AM »

First time using Krita 3.0 animator feature. It's not bad overall. Does have an annoying issue with the arrow keys always scrolling the frames even if another tool is using them, but that's minor.
Already made the corruptor yesterday, here's a closer look:



Also animated the portal effect. It rotates in Unity, but got this GIF directly from Krita so you just have to imagine that.



Lastly the node destruction animation. Simple and ok at a distance... Well, everything is pretty small so I can get away with some one pass assets I think.



Implemented these already in the graphics test level. Not showing more of that before Friday. Should look spiffy at that point. A lot hangs on the background, I don't even have an idea for it yet...

Cheers.

« Last Edit: March 16, 2018, 12:10:15 PM by HuvaaKoodia » Logged
HuvaaKoodia
Level 1
*



View Profile WWW
« Reply #12 on: January 18, 2018, 11:07:20 AM »

One more animation.



It's for the ghosts. Replaced the plain corruption number with a bunch of ghosts circling the nodes. Looks swell and doesn't really affect the UI. You don't need to know the specific number after all, "loads of big ghosts is bad" serves the same purpose.

Nearly forgot, but the other task for this week was serialization. Not a big deal, but did take the usual wrangling with the odd deserialization glitch. Didn't quite get them all out, for instance, nodes still play the corruption animation when loading the state. I'll be adding more graphics later, so those fixes can wait.

I hadn't used Json.net in a while and was surprised how eager it is. By default it serializes public variables, properties and even delegates! Those last two were too much. It kept complaining about Unity sprites... My models don't have sprites! Apparently it tried to serialize some views too via the events. Yeah... Luckily the [JsonIgnore] attribute does the trick. [JsonProperty] on the other hand can be used to add private members to the party.

I really like how Json.net handles object references. The first time around it serializes the whole object and later only writes {"$ref":"52"}. Neato! Saves me a lot of hassle messing with manual object indices or something silly like that. Vector3's worked out of the box too!

Visually the test level is looking quite clean now. The last visible number is the civilian count which will most probably stay as it is. I can live with it. Tomorrow is finally for the background then, can't put it off any longer. Will need to find some inspiration

Cheers.
« Last Edit: March 16, 2018, 12:11:08 PM by HuvaaKoodia » Logged
HuvaaKoodia
Level 1
*



View Profile WWW
« Reply #13 on: January 19, 2018, 09:25:18 AM »



There it is then, the background, with the ghosts and other small tweaks too.

I though about backgrounds and was reminded of those in Jazz Jackrabbit 2, out of all things, and decided to try something similar. An unusual inspiration I have to say, but worked for this level at least. Different levels could have different backgrounds and graphics in general. Unlikely, but I've made sure changing colors is easy at least, so that'll be a thing,

It's getting hard keep the GIF size down at this point so here's a full HD screenshot.

Also animated the pixie and added in a color changing animation to the background based on how many areas have been corrupted so far. You can kind of see it in the GIF.

30% done. Next week is for the dialog system and the character corruption effects, both code and graphics for both!

Cheers.

« Last Edit: March 16, 2018, 12:11:42 PM by HuvaaKoodia » Logged
HuvaaKoodia
Level 1
*



View Profile WWW
« Reply #14 on: January 22, 2018, 11:10:06 AM »

The prose (dialog) system is one from the distant past, something I made for another project all together and have kept up to date through out the years (one major rewrite, lots of refactoring). It has many useful features even for the rather simple needs of this project.

Here's a quick rundown of the data files of the system and how they work, with completely made up examples.

You can define variables in a VariableList:
Code:
VARIABLELIST MAIN
 Name = Jethro
 RiskOfRain = 80
 PaidRespects = true

Text is stored in Data objects:
Code:
DATA Intro1A
 "It was all well and good until the rain came pouring down."

DATA Intro1B
 "The cemetery was spooky at night, but #Name# had yet to press F"

And lastly the most fitting data object is selected with Actions:
Code:
ACTION IntroAction1A
Requirements
 RiskOfRain >= 50
Data
 Intro1A

ACTION IntroAction1B
Requirements
 RiskOfRain < 50
 PaidRespects = false
Data
 Intro1B

There are other nifty features too, such as text randomization and inline logic in Data objects. Will come in handy if and when the inspiration to complicate things eventually comes knocking!

It did take some time to get the system running in MonoDevelop. I originally developed it using Visual Studio on Windows, you see. Had to change the target framework for each separate solution (three in total) and remake the unit tests using NUnit. Mono does output proper DLLs it seems as Unity has no problem with them. This should be future proof enough!

Implemented a short intro dialog in the first tutorial level. Nothing to show yet, but at least data loading and parsing work, as well as the simple text panel.

Cheers.
« Last Edit: January 24, 2018, 12:58:35 PM by HuvaaKoodia » Logged
HuvaaKoodia
Level 1
*



View Profile WWW
« Reply #15 on: January 23, 2018, 12:38:48 PM »

Some days are not for big things. Tweaked the GUI, fixed some bugs, more dialog for the tutorial levels... Nothing to write home about. Lastly added simple "death" animations for the characters. Here's the fox after taking a hit.



Poor fella.

Realised that if I do want to add corruption visuals to the characters, and I do, the animator controllers need to be copied multiple times per character. One of the worst parts of Unity for 2D is the lacking spritesheet support. Swapping out the sprites of a character in an animator just isn't going to happen. There might be a third party solution for it, will look into it tomorrow.

Cheers.

« Last Edit: March 16, 2018, 01:02:12 PM by HuvaaKoodia » Logged
HuvaaKoodia
Level 1
*



View Profile WWW
« Reply #16 on: January 24, 2018, 09:59:43 AM »

Did some research and stumbled upon this page, which I remember reading some years ago for the very same reasons. The first easy solution, presented in one of Unity's own videos, is no good. Constantly switching the sprites of multiple characters in LateUpdate is not a pretty or performant solution.

As luck would have it the most recent addition to this thread yielded an intriguing repo by RetryEntry. The idea seemed too good. Use a custom sprite shader which allows swapping the texture used by the SpriteRenderer. That's all it takes! Inspired by this made my own version with cleaner code, small improvements and an example scene to boot. Here's the repo for that.

Rather pleased of the code side of things, if only making the spritesheets would have turned out to be easy too. So far I'd used individual images exported directly from Krita. As someone familiar with GIMP's countless options and plugins I expected Krita to have similar export functionality too, but no. It does not even have scripting support yet so no help was going to come from there either.

To create the following spritesheets I had to individually export each image from Krita, download the following Fuse layers filter for GIMP, import the images as Layers and lastly run the fuse filter. To make things worse GIMP started crashing after using the filter for no apparent reason. Restart helps, sure, but it's still annoying especially after cursing at Krita for a while (both programs are otherwise splendid, so I can't stay angry for long!)



Needless to say I won't be constantly updating the spritesheets due to this pipeline issue. Monkey work is best done once only, when everything else is in place.

Last thing of the day: added the first "reactive" dialog into the levels themselves. Unsurprisingly it happens when the foxy gets corrupted. I need to come up with a lot more of these at some point now that I've gotten the tools in place.

Cheers.
« Last Edit: March 18, 2018, 02:10:27 PM by HuvaaKoodia » Logged
HuvaaKoodia
Level 1
*



View Profile WWW
« Reply #17 on: January 25, 2018, 10:51:02 AM »



Another one of these days. Nothing ground-breaking, some dialog, some graphics. That there is the shape-shifter with a corrupted heart. They do look a bit like this boss from Megaman 1, now that I think about it. Hmm.

Mostly wrote in to comment on the next few days. Won't have a lot of time for work tomorrow due to Global Game Jam starting up (it's good to take a break from the project by jumping onto another project!). There's travelling to be done.

Next Monday is also mostly spent on other, unrelated, things unfortunately. Will work in these days on some future weekend.

Next week will be for finishing up the first part of the campaign. Basic menus too.

Cheers.
« Last Edit: March 18, 2018, 02:09:56 PM by HuvaaKoodia » Logged
HuvaaKoodia
Level 1
*



View Profile WWW
« Reply #18 on: January 30, 2018, 10:40:29 AM »

A few days off sure did wonders, feeling energetic. We made this at GGJ, a bit of nostalgia for anyone who lived through the nineties.

Back to work. Made 5 levels and added more detail to the shifter sprites. Then some design.



Thought about the three extra characters I'd like to add. The current ideas: an exoskeleton (fast, weak combat ability, can save civies?), a gyrocopter (flying, slow, some sort of powerful corruption clearing bomb ability?) and a tesla tank (two-range electric attack or two simultaneous short-range attacks).

These would be easy to implement, yet they aren't that different from the current characters apart from being more powerful. I'd prefer the mechanics to change dramatically. Will need to look at references for inspiration tomorrow. Drawing blanks.

Cheers.
« Last Edit: March 18, 2018, 02:09:26 PM by HuvaaKoodia » Logged
HuvaaKoodia
Level 1
*



View Profile WWW
« Reply #19 on: January 31, 2018, 10:50:44 AM »

Thought about the characters a bunch. The exo, copter and tank ideas stay, but the mechanics needed some changes.

Most of the ideas I went though did not fit in the current rules and setting at all. In the end I decided to give the copter unit an extremely powerful attack, the ability to destroy a corruptor! Once destroyed corruption on connected noes does not increase any more. Of course if a node is connected to two corruptors then there is no change.

The tank will have to do with a one range attack. Two nodes is too far as the maps are small. I also wish to avoid having to refactor the attacking code too much. The exo unit is melee, but also blocks corruption. The node they stand on can reach 100% corruption, but won't succumb until the exo moves away. I don't exactly know if this changes much, but we'll see once I get the mechanics in proper and make a few test levels.

Cheers.
« Last Edit: March 18, 2018, 02:06:27 PM by HuvaaKoodia » Logged
Pages: [1] 2 3
Print
Jump to:  

Theme orange-lt created by panic