Coder Social home page Coder Social logo

advance-wars's Introduction

You like Arial font?

Anyway.

This project is a rebuild of the 2008 game titled above.
It was chosen because it's a really good game, and because I won't have to draw any art.

You can play the current public build→here. (Beware sound)
Be wary of these issues, though.

The controls are listed below the game window, but I don't have button prompts in the UI yet, so it may still be confusing. I'm working on fixing that.
Uh, just press Z and X a bunch and you'll do things.

You can also play with a PS4/5 remote.
Other gamepads are not guaranteed to work yet, but you sure can try.

Oh, I should mention.
This project is not necessarily for the public. One of the key objectives here is just to demonstrate my skill, the rest are, you know, private fun with private people.

Currently working on:

  • Online play using socket.io
  • Fixing the "player 2 can't play locally" issue I introduced on purpose
  • User-accounts database, and other tables
  • UI-code refactor, and then a user login widget

Features:

Self-Assembling Tileset

Nearly any arrangement of terrain is representable. Each tile examines its neighbors during construction and figures out for itself which sprites it needs to blend in with its surroundings.

I wrote a python script that is definitely outdated now but at one time converted a bunch of terrain metadata I had to generated Typescript code. Saved me a lot of work.

Terrain Info Panel

Every terrain type (and troop type) has its metadata hooked up to the UI panels to answer your burning questions about wheat fields and rock in ocean.

You can open the detailed panel with right-trigger or Shift.

The UI code is awful, by the way, don't look at it.

Troop Pathfinding

Troops travel the path you tell them to when moving. And so, when you draw a path that's too long or too rugged for your poor little bike to handle, the path is recalculated to always be valid, preferring the old path as much as possible.

The search algorithm that does this, I factored-out a bunch of the boilerplate code to make it easier for my brain to understand. Now each map-crawling algorithm can focus near-exclusively on the map itself.

Troop Combat

Troops can attack other troops, and the whole process is animated, too. The UI even estimates your damage and risk, and lets you see where your distance attackers can actually reach.

The troop-command system is already lined up for online play as well. I just haven't gotten around to the server-side yet.

Contextual Actions

The command-menu system triggers different selectable options depending on what unit you're commanding and where you're moving them to.

You can also load troops into other troops into other troops recursively. Isn't that fun.

Animated Special Actions

Explode!

Changes to the board are made via a delayed, event-scheduling system. This missile launch here actually schedules several, the final one being the one that actually deals the damage.

Up to Four Players

For now, anyway. Main limitation is art.
Also, too many players makes for a slooow game.

Each splash screen is dynamically color-adjusted to the team it's representing, which is not something I do for the troops spritesheet. I actually wrote a python script to extract color palettes from png's to make building this feature easier, so perhaps one day.

Stealth and Visibility

Some units, like the Submarine, can hide their presence and ambush enemies who attempt to travel over them. Each player on their turn can only see the information known to them.

The commands you issue to each troop are internally a series of small, discrete actions, which return to the next in line whether they were successful or not. This is how they're made interruptible.

Fog of War

Battles can be held with limited-information, too, where hidden troops are much more common and troops which can reveal enemy hiding places are suddenly not unimportant.

Also, I wrote my own Timer class which handles the tweening of objects, like this flare animation. One of my favorite tools.

Minimap

A full-picture view of the battlefield accessible at any time. It also shows you where the camera's view is and will auto-move said camera with directional inputs or to wherever you mouse click.

Large Maps

Maps can be pretty big because the game makes use of texture caching to skip redundant work on its 2800+ tiles. Or more than that, maybe. Larger than 70x40 makes the minimap in-aesthetic.

Map Editing

Currently dev-only, but it's mostly just missing UI. And a place to store the data. And the ability to resize the map during runtime. And uh... well, it helps me out.

This is actually accessible in the middle of any battle if in a dev build, and in no battles whatsoever when in a public build. I'm all about dev tyranny. I can't wait to program in my own cheat codes.

Known Issues

  • Online-players desync. I do not yet have a backend system for saving the player-action history, so if a player closes the browser, they have essentially removed themselves from the match. The game currently does not recognize this, so on their next turn the game will wait for a non-existing player indefinitely.
  • Camera, zoom level 2 gets stuck because the wait-for-camera system is waiting indefinitely for the camera to move into position, even though it has, and never begins the next board event. You can work around this by simply pressing the zoom button again.
  • Finicky mouse controls. Sometimes you double, triple, quadruple click, sometimes it gets stuck in mouse-down state. These are usually navigable by clicking around in different places to reset the behavior system, but it's pretty annoying, yeah.

advance-wars's People

Contributors

xpgram avatar dependabot[bot] avatar

Stargazers

Playmore avatar CasualYouTuber31 avatar Nin10doGMod avatar Damien Thomas avatar Matthew Masiello avatar eran avatar Calvin F avatar JakeSamiRulz avatar

Watchers

James Cloos avatar Matthew Masiello avatar  avatar Nin10doGMod avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.