Category Archives: Development

What the hell is a ruleset anyways?

As a lot of you might have heard, I’ve been working on these mythical things called the rulesets again, but nobody actually seems to have a clear idea of what they’re for. So time for some history.

When I first started OpenXcom, one of the issues I ran into was how to structure all that valuable game logic. Should I just write it all up? Extract it from GEOSCAPE.EXE? Hardcode it in? Load it dynamically? All of it looking like a lot of work.

Then I thought of how the community loves tweaking. Things like XcomUtil and Ufo Extender are really popular by just letting you tweak little things like changing the starting base layout, giving Skyrangers a weapon pod, making Laser weapons more useful, etc. And there’s all those “game modes” people come up with to change things up. It’d be great if I could accomodate all of that easily. So I came up with rulesets.

OpenXcom uses rulesets to define all the game elements. There is a base UFO Ruleset that defines all the countries, crafts, weapons, base facilities, items, aliens, armors, UFOs, etc, etc. Something like this:


---
countries:
- type: STR_AUSTRALIA
fundingMin: 280
fundingMax: 560
labelLon: 2.35619
labelLat: 0.436332
- type: STR_BRAZIL
fundingMin: 300
fundingMax: 600
labelLon: 5.32325
labelLat: 0.0872665
- ...
facilities:
- type: STR_GENERAL_STORES
spriteShape: 1
spriteFacility: 24
lift: false
hyper: false
mind: false
grav: false
size: 1
buildCost: 150000
buildTime: 10
monthlyCost: 5000
storage: 50
- ...
crafts:
- type: STR_SKYRANGER
sprite: 0
fuelMax: 1500
damageMax: 150
speedMax: 760
accel: 2
weapons: 0
soldiers: 14
hwps: 3
cost: 500000
repair: 1
refuel: 50
range: 600
time: 72
score: 200
- ...
...

 

So if you want to tweak something, you just edit it and modify a value or two. But boy, that’d become a real pain to maintain, having to make your own versions of that big old file just to tweak a value or two. So I decided to make them modular, so that you can combine various rulesets as you please, and they only need to have the things that change. So if you wanted to make a super Interceptor that could detect everything and fly really fast, you’d just need this:

---
crafts:
- type: STR_INTERCEPTOR
speedMax: 99999
range: 99999

 

Or a Super Stingray launcher that would fire a million missiles a second:

---
craftWeapons:
- type: STR_STINGRAY
reloadCautious: 1
reloadStandard: 1
reloadAggressive: 1

 

Or a Super Pistol that would nuke the whole map:

---
items:
- type: STR_PISTOL_CLIP
power: 999999
damageType: DT_HE

 

And if you combined it all, you’d get something like this:

Don’t panic, be safe.

When everything goes wrong …

 

… you better hope you saved your game.

In other words: panicking and berserking soldiers are implemented, but to compensate for that battlescape savegames -finally- have been implemented too.

Since our savegames are not just binary memory dumps like in the old times, they are readable yaml text files, you’ll have the whole battlescape terrain – tile by tile – nicely described for you to edit and play with.
So you can also clone your own aliens, using copy-paste πŸ˜‰

Full life consequences

I hope you’ve all been having fun playing around with the Battlescape without a care in a world… because that’s not gonna happen in the next version! What you do in the Battlescape will actually affect the game. To highlight that, we’ve implemented one of your favorite screens which I’m sure you will see a lot:

Also, the pre-built Windows dependencies have been updated with the new yaml-cpp 0.2.7. And these ones actually work! Not like the last ones that pretended to work but didn’t really because apparently I’m terrible at building libraries… let this be a lesson to you, renaming a file can be more dangerous than it looks.

Holy crap it’s version 0.3!

After 8 months of hard work it’s finally here! Be sure to uninstall any old versions first and read the Documentation carefully for any new features.

New features:

  • Basescape:
    • Craft rearming.
    • Craft equipping.
    • Purchase/Recruit.
    • Sell/Sack.
    • Base transfers.
  • Battlescape:
    • Battle turns.
    • Item equipping, firing, throwing.
    • Environment: fire, smoke, explosions, damage, kills.
    • Unit stats.
    • Inventory.
    • AI Phase 1 (patrol, aggro).
  • New languages: Czech, English (UK), Polish, Romanian, Russian.
  • Support for custom font characters and full Unicode.
  • Options.
  • Platform-specific folders.
  • Partial Ufopaedia.
  • Externalized soldier names.
  • Nag screen only shows once.
  • Swapped F5 and F12 keys.
  • Movable caret in text input.

Bugfixes:

  • Bug in Geoscape pathfinding.
  • Incorrect language names.
  • Cross-platform bug when loading PCK files.
  • Invisible loading errors.
  • Incorrect mouse events.
  • Missing strings.
  • Various UI issues.
  • Various translation issues.
  • Bug in craft rearming.
  • FPS Counter didn’t always show up properly.
  • Crash sites didn’t vanish properly.
  • Failing to load a game could crash the Geoscape.
  • Games weren’t always saved properly.
  • Monthly report didn’t show correct date.
  • Crafts in base view weren’t positioned correctly.
  • Music loading issues.
  • Various battlescape fixes.
  • Various performance improvements.

And as usual, the known issues:

  • Battlescape is still in a “sandbox” mode, so missions never end and anything you do in it won’t carry over to the Geoscape. Take advantage of it!
  • Geoscape sidebar isn’t translated in all languages.
  • You can’t minimize dogfights.
  • UFOs are nerfed to make them easier to intercept.
  • Screenshots are saved in BMP since it doesn’t require libraries. DO NOT share them in this format, convert them to something sane like PNG/JPG first.

P.S. We also got our own shiny domain now, update your links accordingly. πŸ™‚

The aliens are fighting back

While it may have been quiet here on the website this summer, in the background I have been coding on an interesting battlescape feature.

Although not planned at first, so it may come a bit as a surprise, but we’ve put guns in the alien’s hands and gave them brains. In other words : the basic AI is implemented.Β The times where we lived peacefully together with sectoids are now definitely over. The war has begun.

Have fun with the latest build (download it from here) or watch the gameplay movie: