# Car Wars 02 - Pedestrian Movement

949 views

It's been a while since my last developer journal. Mainly because I've been doing lots of things besides development. I've been playing lots of video games: Borderlands 2, Battletech, Master of Orion 2, and Blood Bowl 2. I've been doing lots of Blood Bowl and Twilight Imperium stuff including writing after action reports, twitch streams, and podcasts. I've also been completing some home improvement projects, learning German, working out, and just working.

In short, I haven't made Car Wars a priority and so it doesn't get any of my time. Even though I've been productive in other "useful" things, my goof-off time hasn't really been a conscious decision and so I feel a little bit down from slacking off. This is something I've talked about in previous journal posts. It's okay to goof off so long as you prompt yourself, "Hey self. Instead of playing Blood Bowl, I could be working on my side project... Am I cool with goofing off and messing around instead of making progress?" If you ask yourself that and the answer is yes, goof off with a clear conscious. Otherwise you'll binge several hours of a video game and before you know it, that's one more day without any progress.

Anyway, I actually HAVE made some progress. It's just not as much as I'd like. Most of this was working when I posted the last Car Wars journal. I worked out a few design decisions and fixed a few bugs. I also spent quite a bit of time cleaning up my object pooler, commenting the heck out of it and making the code asset worthy. I still need to do a few things like record a demo video, and create some store page assets for it before I can publish it on the Unity asset store, so expect that in a week or two.

Here's a video for what I have so far:

I have no skills in modelling, animating, or basically anything creative. So I franken-bashed a bunch of free assets together including different animations, a model, and making my own animation controller. I think it looks pretty cool for the prototype stage.

I create the move order ghosts by instantiating a copy of the pedestrian through my object pooler, and make them translucent by turning the alpha of the materials down. To get the highlight effect, I just change the material color to yellow.

// A couple of cached references to the renderers
protected MeshRenderer tokenMeshRenderer = null;
public MeshRenderer TokenMeshRenderer
{
get
{
if (tokenMeshRenderer == null)
tokenMeshRenderer = GetComponentInChildren<MeshRenderer>();

}
}

protected SkinnedMeshRenderer modelMeshRenderer = null;
public SkinnedMeshRenderer ModelMeshRenderer
{
get
{
if (modelMeshRenderer == null)
modelMeshRenderer = GetComponentInChildren<SkinnedMeshRenderer>();

return modelMeshRenderer;
}
}

private void SetTransparency(float transparency)
{
Color color = TokenMeshRenderer.material.color;
color.a = transparency;
TokenMeshRenderer.material.color = color;

color = ModelMeshRenderer.material.color;
color.a = transparency;
ModelMeshRenderer.material.color = color;
}

public void SetColor(Color newColor)
{
Color color = TokenMeshRenderer.material.color;
newColor.a = color.a;
TokenMeshRenderer.material.color = newColor;

color = ModelMeshRenderer.material.color;
ModelMeshRenderer.material.color = newColor;
}

So now I have the very basics of turn-based mechanics worked out. I was lost in the weeds for a few days as I thought about all the different possibilities of how to tackle this problem. Do I let everyone plan everything and then execute in the correct sequence? What about collisions? How about allowing units to plan future phases out? What about keeping information from the other player hidden. How about when two cars are moving really fast and they're nearby each other? Should I present a timeline and allow the user to scrub through it for their planned movement and their opponent's approximated movement? ... and so on.

Eventually I came to the conclusion that I need to just pick a direction and go. So I decided on something a bit simpler for now. Units will move in initiative order, and complete their movement for the phase before the next unit is allowed to go. This keeps the problem space much simpler and lets me work the kinks out of a turn-based mechanics system. As I code this simpler version, I'll try to make design decisions that consider some of the other problems I identified. Hopefully, that will make future refactors and features easier.

### Tips from your Uncle Eck

If you don't make your game dev project a priority, then you won't make any progress on it.

When you get overwhelmed by a complex design, take a step back and try to focus on a subset of the problem. Then expand on that as more of the problem gets solved.

A decent solution now is far better than a perfect solution that never happens.

### Charity Fund Raising

I'm helping raise money through Extra Life which is a charity that helps sick kids. Give a little something if you can. And share the links below if you have time. Thanks!
My Extra Life page - https://www.extra-life.org/index.cfm?fuseaction=donorDrive.participant&participantID=367649

### Notice/Disclaimer

Car Wars is a registered trademark of Steve Jackson Games, and the Car Wars logo is copyrighted by Steve Jackson Games. All rights are reserved by SJ Games. This logo is used here in accordance with the SJ Games online policy

Computer Games based on SJ properties are prohibited so I'll never be able to release this project to the public (not even for free). It's just a fun personal project for myself and the most I'll be able to share is my experiences while working on it. In my pipe dream I'll get this into a cool enough state that SJ Games contacts me to publish the game. But what's more likely is a cease and desist letter. We'll just have to see how things go. Here's hoping.

If you're interested in legit Car Wars products, I recommend Warehouse 23:
http://www.warehouse23.com/products/car-wars-deluxe-edition

Very happy to see more progress on this!

Good call starting with the turn based, you can always later convert it over to a more complex design in the future once you have the basic mechanics down.

Put me in the camp of 'I hope they reach out to you to make it a published game' rather than C&D

## Create an account

Register a new account

• ### Similar Content

• By Wush
As a hobby programmer I am slowly working my way up project by project to make a game. However I am currently stumped on what to do with what I call the communication layer.
To explain: you have an ability, a technology or a building first you need to communicate to anyone effected to apply the effects. Also abilities might need to know when a certain activity is started or ended to trigger or alter their effects.
Events are a tool to handle this, but:
1) You still need an effective filter, so only those recipient are called that fulfill certain requirements(nationalities, race, class, locality etc)
2) You need to know/write beforehand what  method  needs to trigger an event.
I would be thankful for any advice on these two points, is there any way to elegantly append a methodcall with another methodcall?
I mean I could write some kind of wrapper containing a delegate  of a method  and then only call the wrapper, having the wrapper contain a list of additional method calls and their inputs to be executed?

• Snaps, an asset pack on the Unity Asset Store, has a new way to make it easier for developers to make their visions a reality.

You can find out more about Snaps with the video above or by clicking here.

View full story

• Snaps, an asset pack on the Unity Asset Store, has a new way to make it easier for developers to make their visions a reality.

You can find out more about Snaps with the video above or by clicking here.
• By jb-dev
This is the third level's title card.
All title cards will have its colours matched with its level. Every levels also have a unique level seal.
• By jb-dev
This is the first level's title card.