Heads Up

by Kyzrati on 20110729 , under

Recently I took a break from coding the game mechanics to do some research and interface brainstorming. I didn't really want to do this quite yet, but am afraid I'll get caught in the middle of coding some big chunk of mechanics right when a big project comes along at work. I can safely stop random ASCII art endeavors at any point...

The current state of the in-game HUD area is a mishmash of debugging info, so images seen below are just mockups. I played around with some ASCII drawing software over the past few days, trying PabloDraw, JavE5, WEPaint, and ASCII-paint. But by far the award for best RL interface prototyper goes to ASCIIPaint, even though it's somewhat feature-incomplete and (!) runs in flash...

Note: Colors/font don't mean a whole lot here, since I'm not limited to ASCIIPaint's 16 colors and will be using a custom font.

This first attempt was just trying to fit in everything I wanted in the HUD. Aside from everything you see in the original game, there are plenty of extras: "Intel" describes whatever is under your cursor, "Threats" gives a more detailed list of enemies in view, and "Reports" is a quick list of the most recent tactical events.

The reports should be concise yet easy to understand--they're basically symbolic SVO sentences. Here's the meaning of the lines in the mockup (top is most recent):
Sectoid #4 dies
J.Kyzrati shoots Sectoid #4 with laser rifle (burst shot)

J.Kyzrati throws alien grenade
J.Kyzrati primes alien grenade
Muton #2 falls
J.Brenner dies
Muton #2 shoots J.Brenner with plasma rifle (snap shot)
J.Kyzrati no longer under alien mind control
J.Kyzrati under alien mind control
J.Kyzrati panics

Obviously this HUD appears to the right of the map.

The initial attempt was definitely too cluttered...

Got rid of any unnecessary identifiers--it doesn't take long to figure out what everything does, and once you do button/control identifiers are wasted.

Using buttons instead of words in most places, saves space.

Most importantly, adding more information about the handheld items enables direct item-action selection without any intermediate window.

Rank might be better shown as a symbol (also clears up another line).

Soldier-related buttons probably look better if they don't take up quite so much space, as do the level view control buttons.

Still a long way to go with this (and it will be nice to see it with better colors), but it's getting closer to something I can implement for a test version at least.
3 comments more...

Death from Above

by Kyzrati on 20110725 , under ,

Today was all about dishing out the pain! Projectiles now deal their respective damage, cause critical wounds, etc...

After that, went ahead and implemented gravity for entities so that shooting the flying ones out of the air has its proper effect. Killing/stunning a flying unit sends him crashing into the ground (or whatever happens to be below him, hopefully his friends).

Certain objects on the ground may cushion your fall, so you can intentionally jump off a roof into some bushes and hopefully not break anything (probably still a bad idea from the third floor). Or if you're breaching a house from the roof SWAT style, choosing a spot over a bed might be a good idea :)

Here's a screen of testing where units were jumping off the house like so many lemmings... splat!
Such a fall usually wouldn't kill outright, but for testing I had everyone's health dropped to 1, which also made stun tests significantly less of a hassle.

And by extension you get the offensive leap, AKA death from above. You can theoretically jump off a building and drop down on an alien's head--hopefully he'll take more damage than you (wear powered armor for the best effect!).

That gives me an idea for later: What about a quick dog-like alien ally that hangs around on roofs and does exactly that to your soldiers... Now that sounds like a scary terror unit.

Primary recent changes:
  • Added damage effects of non-AOE projectile-entity impacts, taking into account armor, modifiers, etc.
  • Added critical wound system
  • Added body items for unconscious/dead entities
  • Added handling for unit death/unconsciousness/revival
  • Added faction FOV update on member status changes
  • Added falling damage and handling for special cases while falling
  • Added items to map display
0 comments more...

A Different Point of View

by Kyzrati on 20110724 , under

This being a 3D world, a direct overhead map is often just not sufficient to show whether your barrage of plasma is going to take off that alien's head, or just burn a hole in some tree.

Enter the side view.

It's not much to look at, but it serves its purpose as a functional firing aid to show the elevation of your LOF. The side view appears automatically above the top of the map whenever your LOF is displayed on the map, and shows the LOF elevation in every vertical column of cells it passes through. The higher the elevation, the brighter the line (though cell traversal distance still impacts the line's shading).

In the test map below, our soldier fresh off the Avenger already has an enemy in his sights. As shown in the side view (the shooter always appears in the bottom left), his bullet will pass over the fence and through the second story window to smack that alien. Assuming he hits, that is... [Some objects are depicted slightly differently in the side view--you can see the fence is now a '#'; bonus: entities can finally be represented by their proper '@'!]

However, his buddy here has spotted another enemy on the roof, but his line of fire is blocked by a tree... oops. Time for plan B! (I suppose that'll have to wait for when I can add explosives enough to just bring the entire house down :)
0 comments more...

Open Fire!

by Kyzrati on 20110722 , under ,

Finally fired the first rifle shot today! Not at anything in particular, and not that it matters much since projectiles simply die after impact rather than having any kind of effect...

Been working mostly on the internal firing mechanics lately, thus despite a fair amount of progress there still isn't a whole lot to see. Copy of the latest changelog:
  • Fixed misdirection in flying movement handling around obstacles
  • Fixed FOV to improve accuracy of obstruction by prop objects
  • Added Faction LOS check between their members and those of other factions, to record visible entities
  • Added kneeling/standing
  • Changed unit icon size; now larger while standing and smaller while kneeling to reflect smaller profile
  • Added Race data class, which holds data common to all Entities of a given race
  • Added prop height value, determines how they block FOV of entities of various heights (e.g., when kneeling) and LOF
  • Added targeting/firing mode to battlescape interface
  • Added accuracy calculations
  • Added volume parameters to props and entities to define their profile for projectile collision detection
  • Added ray shooting class for calculating projectile trajectories (subdivides map cells to properly detect collisions by object volume)
  • Added LOF calculations in two varieties (option to switch between them): STRICT traces a direct line to the target and considers anything it passes through to be an obstruction; LENIENT will trace multiple lines to target corners/extremeties and try to hit any part it can when the primary LOF is blocked (enables you to hit the sides of large targets that are hiding around corners). So each map cell actually represents a cube of space, and LOF travels through different parts and segments of different cells as in a normal 3D map; visually, LOF is shaded based on its length through a given cell.
  • Fixed visual oddities on side view display when based on high-angle LOS
  • Added Projectile class with collision calculations and simple bullet animation

The shot below shows a Line of Fire. LOF is shaded depending on exactly how much of a cell it traverses. Each cell on the map represents a 3D cube of space, and some objects may not entirely fill their space, e.g., props and entities. Thus in some cases even when your LOF passes through a cell, it may not hit objects within that cell (unless of course you're aiming at the object). As in X-COM, LOF is more restrictive than FOV, meaning you can sometimes see targets you may not be able to shoot at.
If something is blocking your LOF, the obstruction(s) will be highlighted in red and the LOF will also be shaded red.

Here is a soldier standing behind a short fence aiming at a target (currently lower case letters and single walls are used to depict shorter objects, while upper case letters and double walls are used for fully-obstructing objects).
But when that same soldier kneels down (currently represented with a smaller triangle), he can no longer hit the target because he's hiding behind the short fence.

Not enough time tonight to post how the side view works while aiming at targets. I'll put that up this weekend.
2 comments more...

X@COM Has Landed

by Kyzrati on 20110711 , under

Here are some screenshots , as promised. Not much in the way of a complete map, but putting just this together was already slow going without an editor (I'll make one eventually, so long as this game starts to look promising).

There's an Avenger dropship in the SE corner, some streetlights along a road, a two-story house, and beyond that a raised grassy area topped with trees. A small UFO lies in the NW corner. These shots show the map entirely revealed.

This is the bottom level:

Here is the map viewed from the second level. Areas below the current view height have a very slight blue tint to them, and appear a little darker. (This will be adjusted later as necessary.) You can now see the Avenger's hull, the house's second floor, the raised area in the NE corner, the UFO roof, and tree branches for the bottom level trees:

This is the third level, which only has the tops of the streetlights (from where their light is emitted), Avenger and house roofs, and NE trees branches:

No reason to show the empty fourth level, instead here's the same map at midnight (bottom level):
These brave (stupid?) soldiers have now split up--one's searching the house while the other heads for the UFO alone...
4 comments more...

Giant strides...

by Kyzrati on 20110709 , under

...Hopefully not to be followed by baby steps.

I'm starting development with the battlescape, primarily because its design is potentially problematic so it's the best place to start in order to determine the feasibility of this project. (By comparison, the geoscape should be relatively easy to represent in ASCII.)

Progress during the first week of development:
  • Expanded personal game library (which has only been used for basic 2D applications in the past) to include 3D LOS/FOV functions, a 3D pathfinding class, more 3D matrix methods, a handle manager template, and a generic logging system.
  • Defined all major game flow handling classes/modules
  • Defined all major data classes (Cell/Prop/Entity/Item)
  • All data objects loaded from files
  • Can load a rudimentary static battlescape map, with objects, from a text file
  • Map props can be static light sources; entities/items can be dynamic light sources
  • Visibility, and map shading, dependent on time of day setting
  • Can control members of a test faction, walking or flying around the map, which is revealed as per FOV rules
  • Can activate side-view map to see a vertical cross section of a unit's LOS
  • Implemented randomized unit stats, and TU costs of moving/changing facing 
  • Moving units will correctly climb/descend sloped terrain/stairs (fortunately they no longer leap off buildings unless capable of flying) and open doors
  • The entire game state can be saved/loaded at any time

Next up: Firing your gun at stuff. This could take a while longer, because I'll be trying out some new methods I haven't used before...

Screenshots will come soon, after I make the tiny test level a bit prettier--right now it's pretty random...
    7 comments more...

    Introducing X@COM

    by Kyzrati on , under

    I just recently began work on a new project, an X-COM-based Roguelike, and decided to create a blog to post updates and seek comments/advice.

    Check the FAQ for general information.
    0 comments more...