Brad Wardell's Blog


You! Justify your existence!

Published on Wednesday, August 11, 2010 By Brad Wardell In Elemental Dev Journals

image

Finally a REAL developer journal.

In game development, one of the most important polish points is making sure that the game is always responsive to the user.  It’s better to take 1 second longer than to stutter or hang for frames.

Unfortunately, it often gets very expensive in engineering hours to meet that objective.

In Elemental, we have two areas that are particularly problematic in that area before you even get into the game:

#1 When you first launch the game.

and

#2 Waiting for the game to start (i.e. the time after you start the game and you actually get to the map).

In both cases, the delay is due to parsing in XML. It’s completely a CPU bound issue.

Elemental is designed to support multi-core but we also support single core processors too. And when you first launch the game, that’s where the guy with the quad core is going to notice the biggest difference versus the guy with a single core CPU.

image

THIS…

BECOMES…

image
Which has to be parsed…

Anyway…

The “stuff” that has to be loaded before you even see the title screen is in the \english directory.  All the other XML gets loaded after. The problem is, there’s a lot of stuff in that english directory.

Thankfully, tile designs don’t have to go in there.  But UNITS do and “GoodieHuts” and anything you would expect to encounter while setting up the game.

As of now (1:43am on Wednesday, August 11) there is 3.31 MEGABYTES of XML (that’s just text mind you) that has to be read in and parsed.  Heck, there's 65K of hats that have to be parsed (I mean literally, hats as in things to put on your guy’s head).

But by far, it’s the units that are the biggest chunk of it.  And we’re adding more creatures every day.  So this is something we’ll have to find a way to deal with between now and release otherwise, the first impression will be crummy for people with slower machines. 

Either we have to find a way to move the unit parsing into a background thread (not as easy as it sounds) or we need to find a way so that we don’t have so many units being loaded up front.

Now, the other issue, which there really is no way around, is the time it takes after you hit “Start game” and you get to the map.  All those wonderful tiles have to be loaded and parsed.  There’s 11 megabytes of XML there.  It’s the nature of the beast unfortunately and one that I think most would agree is worth it.  But you can bet, many of us are looking forward to going through all 770 tiles we have as of tonight and seeing which ones we could get rid of.

Two weeks from tomorrow

Published on Tuesday, August 10, 2010 By Brad Wardell In Elemental Dev Journals

Greetings!

So much going on right now that it’s hard to do anything other than ramble.  So I will.

image

Random House has sent over some advance copies of Elemental: Destiny’s Embers.

This week we’ve been integrating lots of the lore from Random House into the game itself.

image

A lot of the finalized land textures, fonts and other goodies are starting to go in.  We’re also replacing DirectX 9’s primitive font rendering system with one we’ve been working on for awhile.  I wasn’t sure this was going to get in before release because it’s a pretty big project but it came in ahead of schedule so it’s going to make it in prior to release which is nice.

Today me and Bruno are incorporating the various special abilities into monsters, NPCs, etc. 

They’re doing a lot of work on the tactical battle map and terrain system but I’m not that involved in that area so that’ll have to wait for a future blog.

I’ve been working on the reputation system so that getting married isn’t quite so easy.  It’s going to be controversial but suffice to say, when you’re King (or Queen) you don’t get to marry purely out of “love”. The level of the NPC magnifies how powerful the children are. But the higher their level, the higher your reputation has to be (reputation here defined as your faction’s population/100 * Your relative world power (0 to 1.0).

This afternoon I’m putting in the new diplomacy techs that let you begin recruiting friendly third parties into your armies (various special creatures).

Media Coverage

image In 2010 it’s pretty hard for independent titles to get a lot of media coverage.  However, that’s been changing in the past couple of weeks as we start to show off the near final version of the game .

A few examples:

http://www.shacknews.com/onearticle.x/64973

http://www.gametrailers.com/video/character-design-elemental-war/100928

(http://www.neoseeker.com/news/14458-elemental-beta-journals-pt-1-sexy-mages-battles-and-brigands/)

http://www.pcgamer.com/2010/07/29/elementals-beta-intro-melts-our-nerdy-hearts/

http://www.gamingnexus.com/FullNews/Elemental-War-of-Magic---Interview-with-Brad-Wardell/Item18934.aspx

http://pc.gamezone.com/ads/interstitial/?oldurl=http://pc.gamezone.com/editorials/item/stardocks_brad_wardell_talks_elemental_war_of_magic_galciv_iii_specula/

http://www.fragworld.org/frag/interviews/interview-with-brad-wardell.html

http://www.gamestooge.com/2010/08/07/preview-elemental-war-of-magic-pc/

I also had a great talk with CNN about our no DVD copy protection system.  The integrated modding system in Elemental where people can share creations obviously requires the player to have an account (much like a forum account is required to comment on this blog) and that account is tied to their serial #. Such a system thus rewards paying customers. We’ve already got several post-release updates in the works including a quest pack, a monster pack, and I am taking time off this Fall to mod and play with the Elemental AI which I’m very much looking forward to.

So that’s all for now.

 

 

 

Elemental Modding: Goodie Huts

Published on Saturday, August 7, 2010 By Brad Wardell In Elemental Dev Journals

So you’ve decided to get sucked into the world of Elemental…

So let’s make some “notable locations”.

Step #1: The Tile Editor

First, you make your “goodie hut” in the tile editor.

I’m making an “ancient battlefield”.

image

Step #2: Define the GoodieHut and its “treasure”

  <GoodieHutType InternalName="Notable_AncientBattlefield">
    <Name>Ancient Battlefield</Name>
    <Name>Lost Battleground</Name>
    <Name>Forgotten battlefield</Name>
    <Description>This was the site of some long lost battle.</Description>
    <Rarity>100</Rarity>
    <Destructable>1</Destructable>
    <PreferredTerrain>Land</PreferredTerrain>
    <SpawnRating>0</SpawnRating>
    <Medallions InternalName="">
      <All>EnchantedSword1.png</All>
    </Medallions>
    <TileDesign>N_AncientBattlefield_01</TileDesign>
    <DrawnIcon>Gfx/TacticalIcons/Artifact_Bones1_ClothIcon.dds</DrawnIcon>
    <IconSize>50</IconSize>
    <Treasure>
      <Title>Found a midnight stone</Title>
      <Desc>While walking through the debris of the ancient scene of carnage you find a midnight stone.</Desc>
      <Liklihood>100</Liklihood>
      <GameModifier InternalName="Dagger">
        <ModType>GiveItem</ModType>
        <Attribute>MidnightStone</Attribute>
      </GameModifier>
    </Treasure>   
    <OnSelectSFX>Click_Bones_01</OnSelectSFX>
  </GoodieHutType>

 

Explanation:

image

Step 3: There is no step 3.

That’s really it. You just toss this into say the quests directory and voila. It’ll show up.

Back in Michigan

Published on Thursday, August 5, 2010 By Brad Wardell In Elemental Dev Journals

Just got back from the tour in LA. I stayed in the loudest hotel in the universe. Holy cow am I tired. I’ve been a little (lot) irritable on the forums this week.

The team is working on a ton of things this week from tweaking how Caravans work to putting in the UI for handling saved games in multiplayer.

This weekend I have to really get on the AI. It’s still nowhere near where I want it to be for release. Heck, it doesn’t even do the “Your civilization makes me laugh, give us 50 gold or we’ll crush you!” type stuff.

Over the years, I’ve written so much AI that it’s amazing how it gets into your genetic memory. The algorithms just spring forth.

Scott (Boogie) has been working on the cut scenes like crazy. I keep forgetting what’s in the public betas and when I go back it’s pretty painful because all the spirit is sucked out of them.

But I have to say, the public betas have been instrumental. I don’t think we would have nailed the memory leak issue without the public beta. Basically, Beta 4 is unusable if you have 64-bit Windows and certain ATI cards. It’s a pretty specific case but holy cow, can you imagine if the game came out with that? Though that’s not the only leak but there were people who couldn’t play more than 30 turns before it ran out of memory. That’s huge.

One of the valuable things on the forums has been the concepts and suggestions people have posted. Even when they’re mod proposals.  There’s some great stuff there that we’ve been able to add in already.

Anyway, I’m going to make this short since I’m looking forward to just sleeping now.

Cheers!

Last day in CA

Published on Wednesday, August 4, 2010 By Brad Wardell In Elemental Dev Journals

Today’s my last day in California. In the next few days, the previews should start showing up at which point I’ll be free to tell you about the fairly massive changes to the game between Beta 4 (the public build) and Beta 5 (current build) as well as what’s coming up for release.

The high level changes are:

  • The finalized Game UI
    • The finalized Empire Tree (ala Sins of a Solar Empire)
    • Finalized City and Unit UI
    • Finalized Tactical Battle UI
    • Finalized Font Display (i.e. the replacement of the placeholder fonts with the final game fonts)
  • The Finalized Technology Tree
    • Civilization, Warfare techs are fairly similar to what they are now except there’s a few more of them.
    • Adventure allows players to uncover rare resources, world awareness, and a number of other things.
    • Diplomacy uncovers various levels of recruitable units that you can train – i.e. make friends with special races that you can then train at associated settlement.
    • Magic tree lets players magnify the power of their spells if they have the appropriate shard (i.e. Morrigan’s Hammer does N damage normally but if you control an earth shard it does 2N damage, Maelstrom will do 1 tile of harm normally but do N radius out for every air shard you control. Moreover, the Magic tree will allow players to discover the special abilities within their own champions beyond their inherent ones i.e. You’ll be able to see what they are in NPCs as well as your existing ones suddenly discovering theirs).
    • Zillions of other tweaks and refinements.
    • Random House descriptions replacing placeholder text.
  • The Finalized Tactical Battle System
    • Number of Action points a spell takes to cast is based on the caster’s wisdom.
    • Tons of other changes too long to list.
  • The Final Quest and Notification System implemented
    • Basically nearly all the quests and notable locations from the beta are gone, replaced with the final ones we’ve been working on.
  • Hundreds of other game play tweaks and changes.
  • And of course bug fixes galore, especially on memory (this got fixed in beta 5, I was quite concerned on this one, but thanks to users helping us, we were able to track this down to our effects system not deallocating properly and on certain newer ATI cards on 64-bit windows it could lose 100 megabytes per turn).
  • The Campaign which is made entirely with the mod tools.

So in the next week or so the “gold” version will go out to manufacturing and then we’ll spend the subsequent 2 weeks polishing and enhancing for the release version that will go to users and reviewers.

I’ll go into more detail on these things in about a week. In the meantime, I’ll get back to the mods and such when I have a chance.

 

 

 

 

Elemental Modding: Part 2 – New Factions

Published on Monday, August 2, 2010 By Brad Wardell In Elemental Dev Journals

During the early betas of Elemental, we let users creation their own factions during the game setup. But over time, we kept getting more and more good ideas on how to make this more sophisticated that it became impractical to foist such a complex system onto the player (the UI would just get crazy).

Moreover, having to UI drive faction creation was resulting in factions that were more or less the same. So we moved this into the area of modding.

Let’s create a new faction. I’m going to create a new file called Froglers.xml and put it into my units directory in documents\my games\elemental

Inside I’m putting this file:

<RaceConfigs>

    <RaceConfig InternalName="Froglers">
        <DisplayName>Frog People</DisplayName>
        <Capital>Ribit</Capital>
        <ShortName>Froglers</ShortName>
        <LeaderName>Frogboy</LeaderName>
        <PopulaceName>Human</PopulaceName>
        <Description>This amphibious race hops on all fours.</Description>
        <Alignment>Good</Alignment>
        <FactionAllegiance>Kingdom</FactionAllegiance>
    <DefaultCityWallSet>CityWalls_Fence</DefaultCityWallSet>
    <NewCityHubType>Outpost</NewCityHubType>
    <CapitalHubType>Outpost</CapitalHubType>
    <!-- Race Stuff -->
    <RaceClassification>Frogs</RaceClassification>
    <RaceDisplayName>Frogs</RaceDisplayName>
    <RaceInternalName>Race_Type_Frogs</RaceInternalName>
    <MaleUnitType>Skath</MaleUnitType>
    <FemaleUnitType>Skath</FemaleUnitType>
    <GenericUnitType_Male>Skath</GenericUnitType_Male>
    <GenericUnitType_Female>Skath</GenericUnitType_Female>
    <TraderUnitType>Skath</TraderUnitType>
    <StartingUnitType>Kingdom_Soldier</StartingUnitType>
    <StartingUnitType>Kingdom_Pioneer</StartingUnitType>
    <ChooseFactionBack>Faction_Background_Altar.png</ChooseFactionBack>
    <UnitScale>1.0</UnitScale>
    <UnitSkinColor>32,255,32</UnitSkinColor>
    <UnitHairColor>155,255,75</UnitHairColor>
    <UnitClothing1Color>120,25,20,255</UnitClothing1Color>
    <UnitClothing2Color>78,60,55,255</UnitClothing2Color>
    <UnitMetalColor>145,145,145,255</UnitMetalColor>
    <BuildingPrimaryColor>165,255,130</BuildingPrimaryColor>
    <BuildingSecondaryColor>75,255,50</BuildingSecondaryColor>
    <BuildingRoofColor>90,255,10</BuildingRoofColor>
    <ZoneOfControlColor>165,255,30</ZoneOfControlColor>
    <TechTree>TechTree_Froglers</TechTree>
    <KnownStartingTech>Frogler_Starts</KnownStartingTech>
    <EnvironmentTerrainType>2</EnvironmentTerrainType>
    <PreferredLogoType>KingdomCrest2</PreferredLogoType>
    <SovereignUnitType>Lord_Relias</SovereignUnitType>
    <Spellbook>LifeSpellbook</Spellbook>
    <A_CoreManaRegeneration>50</A_CoreManaRegeneration>
  </RaceConfig>

</RaceConfigs>

 

Now, if you pop this in it’ll crash. That’s because we have to define some things first:

  1. RaceClassification
  2. RaceInternalName
  3. TechTree
  4. KnownStartingTech

Without those 4 things defined, the game won’t know what to do with this faction.  It is in these 4 things that we ultimately make what is special and unique.

I also cheated in terms of the 3D modeling. I used Skaths as my units. Skaths kind of look like frogs in the game so I figured…

We’ll need to define what Frogs are as a race. And we’ll need to come up with a technology tree for them.

Stay tuned.

Elemental Modding: Part 1 – The Basics

Published on Monday, August 2, 2010 By Brad Wardell In Elemental Dev Journals

The first thing to understand about Elemental is that almost everything is put into the DATA directory of Elemental (in program files\stardock\elemental.

By contrast, things you mod should go into the documents\my games\elemental\units directory in general (eventually we’ll just put a general mods directory).

Inside the Data folder is the English directory. As its name implies, we switch this directory based on localization (so there will eventually be a German, French, Spanish, Italian, Polish, Russian, etc. directory).

If you change HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Stardock\Drengin.net\Elemental to have language be say German, I THINK you can actually create a sub-directory called German, copy everything from English into it and start making a German version but I haven’t tried this yet.

Basic Rules to Follow

Here are some basic rules to follow:

  1. The files are irrelevant. Don’t try add on to an existing file. Create a new file. My suggestion is to create files named like UserName_TypeOfFile (example: Frogboy_KlingonRace.xml)
  2. The directories matter. The game scans certain directories at certain times during loading. It goes by the XML keys inside the files and loads them as necessary. Units get loaded up at the launch of the game (something we need to fix because it causes the game to kind of hang).
  3. The XML keys are the (no pun intended) the key. For instance, there’s a file called CoreBoots.xml. The game could care less about that. What it does care is that at the top of the file it says <GameItemTypes>. That means the game will read these in as game items.
  4. Be aware that these XML files have to be read in by the game. If you find loading slow, it’s because it’s parsing megs of XML files as is. It’s a constant battle we’ve faced – wanting to give you fancy stuff without slowing down the loading of the game.

The Basic Objects

Near the top of any XML file you can find out what type of objects are going to be in that file. Elemental has only a handful to deal with:

  • GameItemTypes (things a unit may have on it)
  • UnitTypes (Types of units – a dragon, a bandit, an ogre, Procipinee)
  • MapTypes (Types of maps, currently tiny, small, medium, large, tactical). You can add your own of any size.
  • Spells (Spell Definitions – Fireball, Haste, etc.)
  • TerrainTypes (want more terrains? You can add plenty of additional terrains, this is also where you specify what tactical battle maps should come up. In beta 4, we only have 1 per terrain. yawn)
  • Campaigns (want to make your own RPG? This object type defines them)
  • ImprovementType(for adding city improvements)
  • Quests (defining quests)
  • TileDesigns (these are created by the tile editor) Nearly all our XML files in the game are these.
  • EffectBlueprints (these are credit with the effects editor)
  • GoodieHutTypes (these are the notable locations)
  • QuestLocations (these are where quests originate)
  • MultiplayerMaps (these are maps that will be used as seeds for single and multiplayer)
  • AbilityBonuses (this is where special abilities are added for units, in beta 4 we don’t really use this but in the release version we will)
  • RaceConfigs (this is where you define entirely new factions)
  • TechTrees (this is where we specify specific technology trees. In beta 4 we only have two, eventually each faction will get its own)
  • AIPersonalities (this is where we define AI personalities for use by the game, in beta 4 we only have 1. And until i’m happy with the AI, there will only be 1 made by me).

Over the coming weeks, we’ll go over this one by one. If someone wants to put this into a wiki and elsewhere, that would be great.

LA Bound

Published on Monday, August 2, 2010 By Brad Wardell In Elemental Dev Journals

Paul Boyer and I are on our way to LA to demo the near final version of Elemental. G4’s Xplay is our first stop. It’ll be the first time that the finalized UI system starts to get shown.

Wish us luck!

Mod Week Begins

Published on Monday, August 2, 2010 By Brad Wardell In Elemental Dev Journals

This week, as time permits, I’m going to start documenting all the files and mods for players.

If the community wants to set up a Wiki or something to put this stuff together in, that would be great.

Here’s my first tip because it’s been driving me crazy:

image

In RangedAttackspells.xml you can change the speed of the arrow.  Right now, it’s crazy slow and it’s absolutely maddening.