Monday, January 31, 2011

Lots of new stuff, well sorta!

I just noticed I have some other BT utilities I've created sitting on my server.  With the recent CBT forum crash, and the lack of anywhere to find these links, I'll post them here.

BattleTech Engineer, v1.0.2 (most recent) - This is, for now, just an infantry platoon builder, other units will come as soon as I get to it :)

CBT Cartographer (most recent) - This is a stellar mapping, jump route plotting, planet data sorta application.  It isn't totally done, but is pretty useful.  I don't remember all the shortcuts, so next update I'll add some documentation or a help screen.  Try E, Shift-E, Escape, Shift-J, numpad 2/4/6/8/+/-/0, CTRL-P, U, C, J, N, P, CTRL-F.

Here is a heavy metal pro export of all the data files, and my attempt quite a while back to dynamically determine battleforce stats

I went through and created the most complex battleforce sheets I could, as the templates we were given in some cases do not have enough room to fit some units!  Here they are.

Here are some bitmaps of the inner sphere, labeled star maps without any paths or anything, they are dynamically created but a bit out of date.

Here is a quick campaign map I made for our local gaming group, but nobody liked it :(  The thought process was to use this as a strategic map, each square is a mapboard, and having terrain and random terrain actually make sense in it.

I have contemplated unit designers for a while now, and it really is a daunting task.  There are SOOO many special rules, and when it comes to a computer there is a serious lack answers when it comes to construction.  To write an app you have to take into account EVERYTHING, and the writers often don't.  For example this application shows just how freaking hard it can be to design a mech with *all* the rules.  Its completely unfunctional, I was trying to work on an interface and eventually gave up.  It'll end up being dynamic whenever I do create one (so uglier, but easier to handle).  I'll do mechs last, as they are the hardest to build and Solaris Skunk Works is doing ok for now.

And for those of you who have read this far, something NEW!  It isn't totally done, but this random unit generator will make units according to the rules in SO around page 330.  Right now it just shows the mech/unit weight, but I'll integrate a random unit table later, as well as some overall unit stats.  Here it is.  I'll post something on the CBT forums about it later.

Monday, January 24, 2011

Noise, what noise?

I spent a huge chunk of the last few days looking at things like perlin noise and A* pathfinding algorithms.  While I can figure out pathfinding, I'm not real great at the logic behind it, just making it work.  And perlin noise, as well as any triangle type math, is just beyond my mental capacity.  So I gave up, admitting failure.

BUT, I posted a "project" on the site, which is a place you can go to get people all around the world to do your project for you.  I posted all my requirements, and already have a bid of $1200 for it.  I can afford that!  The bidder doesn't have any reviews, and I have another 50 or so days of bidding.  Hopefully I get some other bids, but if not I may still try to go with the $1200 bid for everything.

What does that do for me?  It allows me to pretty immediately put all the code in place to have a 4X type of game, based on the BT universe, with my own perspective on how technology was lost, how production works, and how fasanomics works.  The graphics won't be any better than megamek, and I may support using megamek to play scenarios until I get the low level combat code worked out.  Great news though!  Of course talking the wife out of $1200 when we have another 6-12 months of debt to pay off isn't going to be an easy sell.  Luckily I can use my GI Bill, go back to school, and make +$1000 a month while I attend!

I started entering in all the record sheet data again, its a long and tedious pain, but I need the data to ensure my "builder" applications are functioning correctly, plus its required to generate random tables, build objects for my other games, etc.  I should probably write an OCR type app that can just recognize the record sheets instead and port the data from them, but I've never gone there :(

Today I helped my boss at work with some C# code.  I have never been big on VB.NET vs C# in any way, but to simply split a string in C# was a serious pain, and I came to the conclusion that C# just blows.  C# and VB.NET have nearly exactly the same speed, capabilities, and features, but things are just soooo much more tedious in C#.  I completely gave up the possibility of ever migrating over to it.  If anybody tries to tell you one is better than the other, they are full of it, both are just wrappers for the .NET compiled language, and the C# to VB.NET converters online kind of prove just how similar the languages are.  The syntax in VB.NET is just so much more sensible, and the people less elitists.

This blog thing seems to work ok, though I'm not seeing many people following me :(  I'll continue to post on it for at least a few more months.

I'll probably start another one with political rants, it'll keep me focused for my 2012 congressional campaign ;)

Bad Syntax

Saturday, January 22, 2011

Hex Maps!

So tonight I played with getting hex maps working right.  This is actually much harder than it sounds for lots of reasons :(.  Right now I've got a 1080x1080 hexagon map that can load in about 5.5 seconds, which on my *very* high end box is too slow.  BUT, it does load, and it does render, and it does zoom, and it draws borders, hex numbers, and a background color.  The mouse over to determine which hex the mouse is over works, but only on the default zoom (I have 7 or 8 zoom levels).

However as I load up all the hexes to start, this isn't going to work.  My goal is to map a planet in few files.  These files will be 4000x2000 pixels.  There will be a file for the terrain height, the terrain type, terrain color, and maybe another file for the water level.  There may also be additional files for height if you want to have underground terrain anywhere on the planet.  So that is 3-4 maps, each around 8-24mb each, for 2500 worlds.  That is about 20-60 GB *uncompressed*, likely 10% of that compressed.  That is acceptable these days IMO, and I may make an option to only download maps as you need them locally.

So, each of these maps have pixels that represent about 10km of actual space.  In the terrain type file each pixel is actually a pointer, by the color value, to a regional template.  This means a single planet could have from 255 to, well, BILLIONS of individual templates.  Yes, this system can be used to map the Earth in 1m accuracy!.

These regional maps are 10.8km in size, and each pixel has a defined scale.  By default that scale is 30m, so these maps are 360x360 BT mapsheets, or roughly 21x21 boards.  There will be support for multiple files, which are divided up by the year on that planet.  This allows a muddy fall map, a snowy winter map, a flowery spring map, and a green summer map... *if* desired.

There will be a few hundred regional maps at start I hope.  This should allow a planet to have coastlines, rivers, cities, forests, mountains, etc.  The maps will allow tiling and rotating, which will be randomly created when required with a random number seed for the planet (so its the same every time).  I *will* need help doing these, but at start I'll probably randomize 20x20 BT maps in each, though it'll be very unrealistic it'll get me *something*. 

The regional maps also have associated height maps, terrain types, terrain color, and again optional water/cave maps.  The terrain types are again dictated by pixel color, and these will directly point to a terrain table similar to BT movement cost charts.  These can also have day/night views (for light maps), and optionally persist damage (that can recover over time) and fires (oops, you just burned down an entire forest).  Each pixel is basically a BT "hex".

Hexes (like clear, woods, or jungle) are defined by the base terrain (grass, dirt, concrete, etc), a level of water, urban stuff, and things like trees.  Damage, fires, smoke, etc will be kept track of on the 10.8km maps, but be accurate per hex.  Each hex definition has textures defined so I can draw out pretty and semi-realistic maps.

Unimportant planets like various moons or other bodies in the system will most likely just have generic maps.

Oh, all of these files will probably be bitmaps, this should help with editing them, or viewing say fires on a planet.

Anyway, back on topic now.  My current hex drawing app can draw thousands of hexes in <1 sec, so it works great, but these are "loaded" hexes in RAM, and I can't do that with my above system.  Instead, with my system, I have to read the hex types out of a binary file dynamically as you move from hex to hex.  I have to create a caching system to ensure I have in RAM, what is needed when a unit goes from hex to hex, without loading things too quickly that may be reverted back to.  I've done this before for a 3D engine, so it *can* be done and isn't *too* hard, but its a lot of focused time I need to spend on it.

I still need some other stuff too, like A* hex pathfinding, some orbital mechanics code, and the code to dynamically generate planets based on their various attributes.

I'd appreciate any help people may want to give!

Latest Developments

Just an update to let ya'll know I am doing *something*, even if not productive ;)

I spent about 2 of the last few weeks working on a star system generator.  It is very close to being done, but still need quite a few tweaks to make it fit better within the BTU.  I also need to figure out some orbital mechanics algorithms to determine things like transient jump points.  If your very familiar with orbital mechanics and would like to help shoot me an email, I could use it! forums were hacked, apparently it takes them *days* to get them back up.  As an IT professional working at to me *days* are just difficult to understand when it comes to downtime!  If all the passwords were hacked, to me the best solution is just reset all the passwords, send emails to all registered users, and restore from the latest backups, but I have this feeling, based on the text, that the forums may be wiped clean.  If they did that, there would be a LOT of pissed off users, including myself.

There was a minor issue in the infantry platoon builder, the heat suit enabled XCT cold when it should have been hot.  It is an easy fix if you open the infantry platoon text file in excel and update it.  I have updated the source code but haven't pushed out any changes.  I kind of wonder how many people really use the stuff I write sometimes, as surely I should have lots of bug reports :(

I worked on the combat vehicle designer as well, which progressed a bit but it still has a long way to go (long way being 1-2 dedicated weeks).

I've spent a lot of other time recently playing WOW again, last night I got my first character to level 80!  Its a paladin of course, and my next highest character is a death knight (since they start at 55) at 60, though I never play him anymore... my next highest character is in the upper 20s, and hasn't been played since the few months after WOW was initially released.  I'm not a guild/raid/social fanatic, I solo 90% of the time, dungeons the rest, but it is still pretty neat, and has some great scenery.  Flying is the only reason I'm back in the game, and surely once I hit 85 I'll never play it again.  I can't justify buying cataclysm as I don't want to pay $40 for an addon with a game that charges $15/month.

Tuesday, January 11, 2011

BattleTech Engineer - Infantry - Update

I just released v1.0.2.0, which reverted the .NET version back to 2.0.  There were only 2 minor code changes I had to make, so hopefully it reverted ok.  Like usual though, let me know if there are any bugs.


Sunday, January 9, 2011

BattleTech Engineer - Infantry - Update

Lots of fixes today, lots of bugs I found, more I created, and then more I fixed.  Here is all I did:

  • Moved the calculation stuff to its own form
  • Update the range 0 to hit, some numbers were off (burst fire weapons, beast damage, etc)
  • Added support for the logo on the form and centered it
  • Added support for unit images on the form and centered it
  • Changed the way weapons are shown, hopefuly it helps
  • Changed "None" to " None" and sorted all boxes
  • Updated all the entries, added all the graphics
  • Added Mechanized SCUBA stats, though its not official it seems to match up
  • Fixed the typo on the form label
  • Went through TRO3085/Supplemental and copied the infantry pics
  • Updated the way platoon text stuff was being displayed
  • Made all forms open center screen
  • Made it so when you print split platoons, it showed them correctly
  • Update the damage display so it goes most to least, and ensured it had all the damage types
  • Fixed the way beast bonus damage was shown
  • Fixed all damage types, mostly range 0 stuff, so it includes *all* damage possible
  • Added support for an error.log, feel free to send it to me if it has stuff in it

Update posted, download here or run the update feature

BattleTech Engineer - Infantry - RELEASED!

I spent most of today (and some of this morning!) working on printing with the latest sheet I designed, and its all working!

Well, I did find a bug after I finished.  I only have 1 blank for the skill, but you can have 6 platoons on a sheet. ARGH, will look at that later :(
I fixed a few bugs here and there, and added some various items like a version checker, a bug page, and you can save to a PNG instead of printing.

Oh, and the printing, its *really* dynamic.  There is a template file you can modify until your hearts content that'll let you make your own sheets, specify where you want variables, and it'll print it for you.  If you really want the classic battletech infantry sheets edit one up, shoot me the file, and I'll add it to the release.  I just don't want to spend any time on it :(

I am SURE there will be bugs, please email me at if you find any and I'll fix them asap!

Friday, January 7, 2011

Other Projects

Some other projects I've worked on in the past, but may not have finished, or posted a link for a download and forget where.

  • Random Unit Generator (SO Rules)
  • Random Dice Roller (specific for BT)
  • Battleforce Icon Maker (All the BF stats on a single "counter"
  • Counter maker (takes megamek graphics, mixed with camo, and makes you a big image)
  • Still working on builders for all other systems, but much of the design and code work has been done

CBT Cartographer

Here is a previous thread on another application I created, the CBT Cartographer: Forum and here is a link to the file.  Here are some excerpts on how to use it:

EDIT:  The forum link apparently doesn't work anymore, the crazy mods on the forums probably deleted or moved it or something.

  • E/Shift-E moves between eras
  • + or numpad + = zoom in
  • - or numpad - = zoom out
  • Up/Down/Right/Left or Num8/Num2/Num4/Num7 = Pan
  • Backspace = Center
  • Escape = Exit (I think)
  • CTRL-P = Find jump path (spell planet names correctly!)
  • P or U?= Show/Hide current jump path
  • C = Show/hide comstar logo overlay
  • J = Show/hide jump radius
  • CTRL-F = Find system
  • N/P = cycles through all systems that matched from CTRL-F
  • Right click (sometimes you have to do it twice) takes you to a entry for that planet (if it exists) and escape closes that window
  • If you left click on a planet it'll center it, and if you don't move the mouse at ALL it'll just show you other systems within 9pc) - its flakey

Haven't worked on this in a while, it was initially just a test for some ways to do a succession wars type 4X game, project just grew a bit :) 

BattleTech Engineer - Infantry

This is my first blog, an attempt to avoid the moderators moving my topics over at the forums.  It will also better allow me to support my products and announce new features and new releases.  Hopefully the dedicated followers among you can give me good feedback to help me make the applications more intuitive and easier to use.

Here is a duplicate of my last post over there:
Here is what I got so far:

No print functionality, need to finalize the sheet.

There *are* bugs, I'll list the ones I know below (and there is a menu button that displays this too) which I'll get to soon as I can.  If you see something NOT on this list, and want to let me know, please get a sequence from startup that led you to the "bug", and I'll try to duplicate and then fix it and produce a new version.

Known bugs, issues, or things not yet implemented:
::   I'm not 100% sure I always let units have 2 SECONDARY weapons, because I thought that meant SECONDARY weapons (
::   If you have a Manai Domini with >4 limbs, only the effects from 4 can be used in any turn, I am not modeling that.
::   Not taking into account the damage type with prosthetic weapons, just a damage number
::   Not sure if my BV is 100% right, some are a few points off, probably because I'm not rounding until the end (and am not real sure when to round))
::   MD Implants have no cost, introduction year, tech rating, or availabilities (maybe these are in ATOW?)
::   Suicide Implants (ISP, p121) aren't implemented yet
::   Mechanized SCUBA, Minelayers, and Portable TAG have no rules yet.
::   Genecasts (P128, ISP) and a couple MD rules in that book aren't implemented, and may never be
::   Changing squad size doesn't update the # of support weapons

I am planning on adding:
:   Add support for images, notes, source, page
::   Print to various forms
::   Can select random unit quality UPON PRINT for each platoon
::   Maintenance Per Week (P170, SO)
::   Infantry status table (P174, SO) - basically pre-existing damage
::   Battleforce stats & a battleforce page with lots of platoons
::   RPG Stats, maybe the ATOW squad sheet or this platoon (battletroops 2, YEAH!)
::   Create an infantry damage quick play sheet (just all the tables needed for infantry play on 1 sheet)
::   Create a bug submittal form
::   Version checker/update downloader
::   Look through TO/SO/TW/ATOW/etc for additional rules, and through all errata
::   Option for realistic damage (so short range weapons aren't added to long range damage, basically a Primary/Secondary/Disposable line for damage and accuracy)

I am pretty sure most of the bugs will revolve around change the platoon size, squad size, # of field guns, # of paramedics, or # of secondary weapons.  Many of those things can actually modify each other, and there is a good possibility of endless loops the way I wrote the code (which I completely REWROTE 3 times to get rid of issues like that!).

All the other bugs are probably things I think will probably be rules based, or some errata I didn't know of.

Hope its useful.  I'm planning on the same thing for all other equipment types next (and in some cases, they are easier!).

All of these apps will be rolled into one as they are finished.  Once they are all done, amazing things will come after Wink

Input is *greatly* appreciated, the more I think people are dying to see what I'm doing, the less likely I'll end up playing WOW because I'm not in the mood to program Wink