Hot Summer Action!
July 12, 2008
Is something sadly missing in my life these days. However, as all good Minnesotans try to do, I manage to spend all weekend outdoors during the summer. Which leaves very little time for TR coding. But fear not, our summers are short, and a good chunk of the TR team is on the bottom of the world, so it’s winter for them. So theoretically, they’re all being super productive
Some of you may have noticed that we transitioned the Target Rabaul web site to a Joomla site, from the creaky old PostNuke site we had been having hosted by Mark 9 Systems. LeadDog and the others are still working on content, but this is a good thing: we’ll be able to better control our content, and more than one of us can update it.
Fun Terrain Coming Up
There was a neat discussion thread in the TR dev forum about how we want to do trees in TW2. Ebola posted a great series of pics of how other sims have done it, what the poly counts were, etc. Since I was actually home this morning, I had a chance to chat with Sick about it. It’s not all finalized yet, so Sick didn’t feel comfortable bragging about it yet, but I think it’s safe to say TW2 is going to allow some seriously cool terrain clutter. I will of course post more when I know more.
All UI and No Play Makes Yak a Dull Boy
June 12, 2008
I haven’t been working on much the last week. Since it’s summer in this part of the world, and since our summer is short, I tend to spend the weekends outdoors as much as possible. Didn’t get much done this week because of work and low energy, but I did put the UI stuff in the background again, and return to campaign work. Joemac and Sick are changing a lot of stuff right now with the UI code, so I’m going to let the dust settle there before going back. Also, the TR team is still working on how they want the new web site and UI to look, so it’s a good time to pause on the UI.
Have Terrain, Will Travel
I don’t think the Mac bug with “tool” has been fixed yet, so I got a windows copy from Joemac and built a TR terrain using Parallels VM. (And no, I don’t care that you think VMware is better: I paid for Parallels early on before VMware could be bothered with Mac users, and it works just fine for my purposes). I haven’t hooked up the new terrain yet, I’ll do that next week I hope.
Next Task: Saving/Restoring Campaign State
My next job is to start moving away from my campaign testing script, which ran a kind of accelerated campaign when you clicked a button. Pilot actions were all simulated. What I’ve been working on this week (or meaning to work on, anyway) is adapting the code so that you can have cold starts (fresh campaign) or re-starts based on the last saved campaign data. Based on my comments in the campaign code, I see that I’m targeting a campaign length of about 3 weeks long. More than enough chances for the server to crash (probably same “Chinese hackers” that are hitting up those congressman’s pcs!), Bloo to stumble through and yank out the power cord, or the server to collapse in self-pity when faced with 300 raving TR fans shooting each other down all night long (Hey! I can dream, can’t I!?). Smooth sailing so far, thanks to these little TW lua gems:
UI-fer Madness
June 4, 2008
I have a new UI for TR2 now. Graphically, it’s based on Popgirl’s design for the TR web site (the current TR web site, not the new Joomla one the team is working on). Internally, it’s based on a UI sketch Joemac (from TW) let me crib from. And let me just say that I love steal… err, recycling, other people’s code. Especially when it’s in a language I don’t have a lot of experience with. Nothing like debugging code you didn’t write to teach you new things! Anyway, I got a handle on the code, made the modifications I needed to make, and figured out the texture mapping functions Sick programmed for the GUI, and it’s all good. The only thing I didn’t bother to do was make a TR-specific UI Theme, I just used one of Raff’s old themes. Looks pretty good to me, but I think the TR Dev Team may want to go a different direction visually. And that’s fine: all we need is a new texture drawn, and a theme to control how the widgets are drawn. Here are a couple screenshots, one English, one Japanese (slightly different buttons, Japanese version is 1 day newer):
In case it’s not obvious, I should point out that there are no elements of this UI that involve text “frozen” in images. Those buttons are all dynamically generated, with the graphical appearance controlled by Raff’s UI theme, and the text being inserted on top of that by the lua UI. The advantage of that is that you can change text whenever you want, you don’t need to go to a graphics program, save a new image, etc. Localization also becomes dead simple, as you can see from the snapshots.
Lua Tidbit of the Day: GUI Event Handlers
I’d like to start a new segment that introduces a little bit of lua. The concept I introduce will probably always been related, if not specific to, Targetware 2. Please feel free to post suggestions for topics you’d like to see covered. I don’t have time to cover anything in depth, as every minute I spent on the blog is another I don’t spend on TR2 development!
Probably because I’ve been working on UI stuff for the last few days, I’m going to talk about event handlers. In the TW2 UI system, every control (“widget” in TW parlance) on the screen needs to have an event handler if you want it to do anything. An event handler is nothing more than a function that is called when something happens to the widget. Every UI is going to have a “logoff” or “quit” button of some kind, so let’s use that as an example. Let’s say you have created a widget, and it’s a button, and it’s named “myquitbutton”:
-- event handler for quit/logoff button function logoff( w, e ) if e == gui.action then client.quit() end end
There is only one line in this code that actually does something: the 4th line, client.quit(). “client” in this case is the TW2 “client application”, running against a server. Executing this command would return you to the TW startup screen.
So what are “w” and “e”, you ask? In TW2, gui event handlers must be able to handle w and e. The game passes these automatically to the handler. w is the widget that was acted on, and e is the event that occurred. So in line 3, we’re testing to see if the event was a gui action. Most of the time, that’s what you’re going to be wanting to handle. In other words, if this function is set as the event handler for a button, in plain English, it means: “If somebody clicks my button, then log off the server ASAP. If some other event happens, don’t do anything.”
So you’ve written the event handler for your button. The only thing left to do is to teach TW you want the event handler associated with your widget. All you need is a line like this:
myquitbutton:eventhandler():add( logoff )
That’s it for today.
In the Mood
June 1, 2008
A couple of fun videos on Youtube:
- Ki-43s and P-40s and Buffalos, all footage shot by a Japanese film crew. I don’t know the origin:
http://www.youtube.com/watch?v=18gR1Y0XMp4&feature=related - Ki-43 (two-blade prop, so probably Ki-43-I) test flight. Note the awesome snap rolls:
http://www.youtube.com/watch?v=EDt6jOOIkpU&NR=1
Now if that doesn’t get you in the mood for Target Rabaul 2, nothing will!
Progress Update
Almost got tool working on my OS X box, it started to download terrain files, then curl ran into a segmentation fault. Wade is working on it. Closer, but no cigar yet.
Codewise, I cleaned up some things, made the localization code more robust, and then started to implement a new UI, based on some code from Joemac. I realized it’s really not that hard to make a decently pretty interface. In fact, it reminds me of the old days (I won’t say good old days) of laying out web sites in HTML using tables. I should have a screenshot to post pretty soon. Still working on making Joemac’s code my code (ie, figuring out what the hell it’s doing)…
TR Web Site Getting an Upgrade
The TR Dev team is working on a new home for targetrabaul.com. It’s not up yet, so don’t go looking. Looks like the team has settled on Joomla, which is an open source system with a content management system in the background (as I understand it anyway). This should make it a lot easier for us to add new web content.
Good Housekeeping
May 28, 2008
I finished up draft 1 of the TR game design doc, and passed it on to the TR Dev Team tonight. Hopefully, we’ll get a good discussion going on it, agree on the major points, then put it up for more community comments from the TR community.
On the coding side, I didn’t get much done tonight, just re-organized the files a bit in preparation for switching to a different SVN repository. I also picked up a newer build from sick that fixed a couple UI glitches I noticed earlier. Still no luck on the “tool” build for OS X. GH sent me a couple interesting pictures showing some data glitches in the geo file repository that TW2 (also) uses, and mentioned patching the data. I’ll try to get with him once I’ve got “tool” working and can see some of these things for myself. I’ll also get some info for you all from sick on how to customize the terrain.
No Coding… Only Game Design
May 27, 2008
I was out of internet reach for the weekend, so I worked on a TR2 game design document. It started out as a UI design document to show the troops on the TR dev forum. After I got started, I realized I had to flesh out more of the game design before I could mock up a UI. I’m still working on the document, it’s kind of fun actually. It’s an exercise in ideas, which is a nice break before going back to actual coding, which is sometimes an exercise in debugging. At least for me, at this point in my lua career.
I’m going to post this on the TR dev forum when I’m done, collect comments, and then maybe show it to interested TR players for feedback. I can’t promise I’ll accept all comments, but I’ll certainly keep them in mind when doing implementation. And, if you don’t like how it turns out, you can always code up your mod totally differently! I’m looking to try something a little different with squads in TR, and see how it turns out. It could be a very good thing. Or it could backfire and suck! If it does, we just yank it and that’s that.
Take This Localization Code and Shove It!
May 23, 2008
Yeah, that’s right. Shove it in the “done” shelf! I’m finally done with all the localization code, put the final touches on tonight. I’ll write up usage later, when it’s closer to a public release.
Mod Makers: Keep Working on TW1? Move to TW2 Immediately?
I’ve seen this question a few times now. The only real answer here is “Do what you think is best“. But if you want some unsolicited advice (the kind I specialize in), then I would suggest you can do both if you want. I can’t tell you yet what the animation (.anm) format is for TW2, and I can’t tell you what the physics files will look like, but your 2D and 3D artwork is going to work as is in TW2, so you won’t lose anything by continuing to build up artwork for planes. I wouldn’t spend any time on terrain if it was me, unless if it was to build ground clutter 3D objects. Time you spend on scenarios is not going to be easily leveraged for TW2, but we’ve got some time before TW2, and new scenarios are always appreciated by the players. But while you’re working on TW1 stuff, now is a good time to start preparing for TW2.
First Steps for Moving Your Mod to TW2
There are 2 things you can work on right now, without knowing any more about TW2 than you already know:
- Gameplay Design – Ask yourself: what happens when a player logs into my server? What does he do? Does he get right into a plane? How many teams are there? Are there missions? Are planes limited to historical “sides”? Is it a free for all? Are there older generation planes mixed in with later generation planes? Is there a ground war? Can players affect the ground war? How? How do you win or lose the game? What happens when you die? All these questions you need to start asking your team now, if you haven’t already. Forget about what you could do in TW1. Ask yourself what you want to do, if you could make the rules. Because in TW2, you ARE going to make the rules. Or copy them from a fellow mod team (you lazy bastige).
- UI Design – In TW 2, mods have their own UI. What your UI will look like is part art (or lack thereof, if your idea of a perfect user interface is one based on a UNIX command line), and part function. You need to decide on a theme, colors, etc etc, but beyond that, you need to know what your game design is, or you won’t be able to make a UI that meets your needs. You can make your UI 3D if you want, you can make it 1980s arcade retro, but however it looks, it needs to support your game play. It’s worth investing some time and thought here.
Anyway, those are my recommendations for mod teams trying to decide on a course of action. Note to TR Dev Team: We really need to get started on a UI. Not graphics, but how we want players to interact with it, in relation to our Zones campaign. Will post on dev team forum.
TW2 Q & A: 1 km Long Spaceships
On a previous blog entry, Vermillion Leader (friend of Imperious Leader? Inquiring minds want to know) asked if there were any issues in making a spaceship for TW2 that was 1 km or longer in length. I asked Sick about that, and his answer is:
no issue at all. in fact, rock the [beep!] out!!! i suggest a 100 km long space ship :)
I asked him if the code that reduces poly count of objects rendered far away would affect a ship that was basically near and far to you at the same time, and he said no, because that code is actually based on the size of the object on the screen, not it’s proximity to you. So, A) we should pitch in and buy Sick a shift key or two, and B) mega spaceships seem totally do-able, can’t wait to see them!
Grinding On (and On)
May 23, 2008
Today and yesterday, I worked more on the localization code. The actual code that makes a different language appear has been done for a while, I used something very similar to what I use in other programming languages. What I’ve been doing the last 2-3 days is writing some utility code that a mod developer would run whenever they added new strings to their UI or campaign. What it does is go through all your lua files looking for calls to the “localize this text” routine, and extracts anything it finds into XLIFF files, one for each language you want to localize to. Then you send those off to your army of translators, they translate the new strings, and send back the xliffs. Done. Next time you run the program, your UI and campaign will take advantage of the new translations. So one of the nice things about TW2.0 (and your 2.0-compatible mod, if you choose to use this localization lib) is that you can have a totally localized UI, for basically no pain at all. Which, if you’ve ever done software localization before, you’ll know is a rare thing.
Mod Developers and Players Want to Know: What the @#&( is an XLIFF File?
Ah, glad you should ask, brave translator. XLIFF is nothing more than an xml file that contains paired translations for (usually) 2 languages. It is an open standard (I’m using the newest 1.2, but because I’m only using a very little bit of the format, it should load in editors that only support 1.1 as well), which means that any tool that wants to, could understand it. Basically, it is, in my opinion, the best format to use for software translations (no surprise, since that was probably the main driver in the standard’s creation).
Fine, you say, that’s about as interesting as watching mud flow. Well, in practical terms, it will let anyone working on your project translate it with translation memory tools such as Trados, SDLX, Swordfish, etc., without any prep work. And that means better, faster, easier translations. If any enterprising mod team could get a pootle server setup, all the mod teams could share it, and we’d really be cooking with gas then! Pootle is, as I understand it, a server that you can feed xliffs, and have people translate them through a web interface. But it looks like you have to be a *nix ubergeek to set it up, so I haven’t tried. I’m only a fledgling *nix geek.
Do I Need Lots of Money to Translate this XLIFF Thing?
No! Just send whatever spare cash you have to me (break your piggy bank, go check mom and dad’s dresser), and I’ll tell you how you, too, can participate in the wonder of translation memory. Oh, fine, here are a couple ways to do it for little/no money:
- Sun’s Open Language Tools XLIFF Editor. This is a free tool, open source, released a couple years back by Sun. I believe it supports 1.1. Works on all platforms.
- LocFactory Editor: This is a Mac OS X tool, free “lite” version, or I think $30 for one that actually does TM. I’ll probably pick up a copy of the full version one of these days, and let everyone know if it’s useful.
Or if you’re really crazy, you can just edit the xliff file with a good text editor. It’s pretty straight forward. Of course, you don’t get the advantages of translation memory, but that probably is ok because you’re stark raving mad.
Show Me the 現金!
This screenshot is a few days old, and it shows off the truly ugly test UI I’m using for TR right now. Oh, and it’s localized for Japanese. Japanese for drooling idiots, because *I* translated it myself, and that is never a good thing!
The date in the corner, by the way, is not the RW date, but the date I had the time set to in TR when I took the snap.
What you are looking at is my TR test menu, which has only 2 options: “Start next gen TR campaign test”, and “exit the server”. The other window is a chat window, with a sentence from the server informing me that an unnamed player has logged in. The localization system lets you translate a sentence with placeholders for names and other things you will want to substitute in on the fly. So in this example, the player name is substituted into a string already translated into Japanese. Don’t worry, you’ll thank me for it later. (Or Else)
Holy Crap That’s Ugly
Yeah, well, Yak don’t do no art baby. If will be my pleasure to continue to show you ugly stuff I work on, so please DO complain. If you want to see some real UI examples, check out Raff’s blog from last summer on some ideas he was working on. He’s planning on getting together with Sick a little later this summer in London to get his UI work updated to the latest TW build. And remember, in 2.0, there’s one TW UI, and then once you select a server, you get the UI specified by that server. So if you have a Space War mod, well, your UI could look completely different from a WWI mod’s UI.
On the font: I’m not crazy about the way it shows Japanese, but as far as I can tell, this is the only freely available (and hence distributable) true type font that supports (basically) all of unicode. If anyone knows of a better one (a gothic/serif one would be nice), please let me know.
Terrain Update
Haven’t been able to get online at the same time as AU for the past few days, so no progress on getting tool to run on my Mac. There’s an interesting comment in from GH in the post a couple day’s back, for anyone interested in terrain.
What’s Next?
Unfortunately, I still have more boring localization code to write, but I can see light at the end of the tunnel. Tonight was actually a bit of a breakthrough, so I’m feeling good about my chances to start next week working on something more interesting. Not going to be doing anything over the weekend (unless someone wants to buy me a macbook or macbook pro so I can work on the road? No? Bastiges.).
This and That
May 20, 2008
Tool Progress Update
I was able to build “tool” yesterday, but it was missing some libraries or something, Wade is going to take another look at the xcode set up. I’ll check back in on that as soon as I have a chance to play with it and make some terrain. Here’s the command I’ll be using:
tool terrain 143.0 0 163.216 13
Being geographically challenged, I’m not sure I got that right, but I’m led to believe it’s about the same territory we use in TR in 0.64.
Lua Update
I’ve been working on the localization code for the TW UI, and for mod UIs and servers. I’ll put this out as a library anyone can use in their mod. Nothing too sexy to report, because I did all the fun parts already. Right now I’m writing some routines to traverse a file directory, find .lua files, and vacuum up any localizable strings it finds, and add them to an xliff file so you can translate them. I’ll talk more about localization in another post. It’s one of those things you want to design in from the very beginning, because it’s painful to add it in later. I must say I’m looking forward to finishing up that module, and get on to the next thing in my project plan, “have supply targets increase for winning side”.
Well, ok, I don’t actually know when the build happened, I found that time in a timestamp in the Targetware log today when trying to remember what day I got it to build for the first time:
080513 19:20:55 2.0.569
I’m guessing the build would have finished oh, say, 3 seconds before the time in that log. I’d never used xcode before, but Wade had it set up nicely for me, all I really had to do, once I had all the right files, was to hit the build button and wait. Normally, most apps only use one of the 2 cores in my CPU. xcode made both little bars go up to 100%. Yeah for something truly multi-threaded! (I still think multi-core CPUs are a pathetic, and short-term direction for computing to have taken). Since it had gotten to about 95% done the night before, and then failed, I didn’t actually think it would go, but this time, it finished with no errors. There was the little round Targetware logo on my intel iMac. Double-click time.
Not that it actually started up the first time, mind you. But the log was there, and a couple commented out lua lines later, it started up, loaded sick’s test UI and test “campaign” (and by campaign, I mean a world and solar system populated by a single 3D object). I looked around, saw some mountains or hills, some valleys, and in the distance, some water. Looked up, saw the sun, with a nice, err, sun effect going on. Saw some stars. Saw the moon low on the horizon. Joy.
Doing a Little Exploring in the New World
Not having much in the way of instructions, I just started plinked around on the keyboard until I found most of the controls (“-” and “=” being 2 I didn’t find right away: – slows down rate of movement, = speeds you up… very handy when you want to move out of the solar system and check out some other stars), and then started checking out the new terrain engine. As I mentioned, I didn’t know how to speed up, so it took me a while to figure out I was in Southern California. Once I got to some pretty high alt, I could see the Baja Peninsula. But before that, I was down by the water checking out the waves. Yeah, waves. They move. They have height. They reflect sunlight (if you’re at the right angle to the sun). And no, I can’t take a pic. Well I could, but you wouldn’t think it was anything special. Sick showed me a couple screenshots a week or so before, and I thought (Don’t kill me sick!): “huh. That’s, umm, nice.” But when you’re down on the waves, at 0 alt, and you see them doing wierd-old wavy stuff (hey, I’m from the great plains, our waves are on lakes, and they only go one direction), well, it’s just pretty damn cool.
I had No Idea the Moon was so Far Away
So after I finally figured out how to zoom faster (ok, Sick told me how), I went out exploring a bit. You know, zoom over some mountains, that kind of thing. Except I zoomed into space. Looking down, I can see the entire Pacific Coastline, and a good chunk of North America actually. The world curves around, and it’s really dark outside now. The Sun looks different from here. I zoom down again, it’s pretty smooth. Zoom up again. Where’s that Moon thing? Can’t find it. Ask sick, he assures me it’s there. Finally, after circling around the planet a bit, I see this grey thing out, far out. Just a little gray thing. I head over to it, and damned if it’s not the moon. I mean, it’s THE moon. Just like the pictures. I always thought it was a lot closer to Earth. When you get out there, and look back, the Earth is just a little blue ball. Makes me appreciate, more than I ever did before, how incredible those Apollo missions were.
How Terrain Works in TW2
Let me be honest: I don’t fully know yet. This reminds me of the old, old days when it was like TW 0.31 or something, and I was just trying to figure out how things worked. Apparently, it’s pretty easy to build a new terrain. Wade just let me know that I should be able to build the “tool” tool with xcode now, so I’ll build that in a bit and let you know how it goes. From talking to Sick, it seems like tool does a lot of heavy lifting for you now. It downloads the geo data, etc., for the coordinates you give it. I’ll have a separate post on that soon.
From looking at the terrain in game, I would hazard an edumacated guess, and say that it knows about the solar system (ok, I know it does, I looked at the lua loader for that), and it has a rough texture for the entire Earth. If you have loaded a detailed terrain, it will show that in varying degrees of resolution, the closer you get to it. I took a snap that shows, on my iMac anyway, the difference between generic Earth terrain, and a detailed terrain (in the TW1 sense):
Ok, off to see if Tool will build tonight, and get started on a TR terrain.




