What tools were/are used in the creation and upkeep of Triton?


Continuing the discussion from New Rule - Ship limits at stars:

Just out of curiosity, what language are you using? Are you using Java on both frontend and backend and then transpiling the Java to JavaScript with GWT, or are you using something like TypeScript on the client, and something else on the backend?

No reason in particular for my asking, but I am very curious as to what makes Triton tick.


Sorry when I say the scripts are compiled they are just uglified and copied into a single file. There is a URL for accessing uncompressed scripts that I use in development.

I just use Vanilla JavaScript with a little jQuery to help me with compatibility. I only support ie9 and above because the game requires HTML Canvas. I have my own strange way of building interface that uses only javaScipt and very simple CSS. I think the whole HTML CSS thing is really broken.

The server is Python 2.7 on Google App Engine.

I have been day-dreaming about how I might be able to move the game over to Node so that both the client and server is js. Python is my favorite language without a doubt, but there is a lot of value in being able to use the same code on the client and server. It I were to start again today it would be on a Node server.

I could go into more detail if you are interested in any particular area, or helping hack on the scripts a little.


Could you elaborate a bit on this? I poked around in the “/gameu” scripts a while back, but I’m still not 100% clear on how you’re doing this with vanilla js. Also,I agree that HTML+CSS is a huge pain.

Any reason in particular for using Python 2 instead of 3? I assume it’s for compatibility reasons with Google App Engine or existing code from NP1/used modules maybe? Also, Python FTW.

I’m curious what the codebase looks like on the backend - I know Python supports OOP, are you doing an Object-Oriented style architecture or something different?

Like I said, I’m pretty curious about what the codebase in general looks like. I know one of your longer term goals for this year is to improve the AI and limit stagnation if one player gets too defensive, but from a developer’s standpoint, do you have any “papercuts” or smaller issues that you would fix if you had more time? I do have more time over the next couple weeks than I normally would, so I’d be happy to contribute in some way if you like, whether it’s documentation, bugfixes, whatever.


So, basically i just use jQuery(document.createElement(“div”)); to build divs with specific dimensions and class styles. I prefer to use absolute positioning wherever possible, and only use relative to expand the height of an element when text is of variable length.

If you look in the code I have a bunch of functions that return these ui objects which I just add and remove to DOM as required.

The map just a big fullscreen canvas and is kind of something special.

I’ve tried to use a Model / View / Controller pattern.

I have one huge blob of data called Universe (the model), it doesn’t know anything about the rest of the game but has functions to manage its internal state.

The interface knows about the Universe and can look in and grab data out of Universe to populate views, but should not change anything in there. It doesn’t know anything about how the game should work and simply throws events when the user pushed buttons.

The controller is the brains of the operation, its responsible for understanding what the player wants to happen when an event is fired by the ui and updating the universe model or show interface as required.

Yes, App Engine doesn’t support 3,. I would love to be using it.

Yes, kind of OOP, Stars and Carriers and Players are all objects. But these days I find myself leaning towards very light objects and with modules of functions that run on the object rather than a method on objects themselves. The AI for example is not an object, its just a module of functions that the game is fed into. (right now anyhow)

@HULK has a bunch of things we would love to see done. I was just about to do the one where the order of techs is always different today but ran out of time.


Being a software guy (Perl, not PHP/Python - otherwise I’d offer to help out), I just can’t help myself filing bug reports and enhancement requests when I notice something that I think would improve the code.

As always, just trying to provide constructive feedback that hopefully helps the NP community.


Yes, I wasn’t trying to be narky or anything. I appreciate that you log the issues, and the reminders are important too because it says that those things are bugging you. If they are bugging you they are probably bugging hundreds of others.

I was serious when I said we should fix the issues that you have been reminding me about!


@HULK I know the feeling, I’ve noticed a few minor issues as well. @JayKyburz I know that triton is and will remain closed-source for the foreseeable future (although I’m sure I’m not the only one that would love to see it open-sourced) but I think I can reverse-engineer/work with the frontend enough to fix some minor bugs when I have time. If I accomplish anything, I’ll post it here, I suppose.

That reminds me, when does the AI know to execute decisions? I assume they have various methods


(Oops, I just realized that my message wasn’t finished when I submitted it)

…I assume they have various methods determining ship movement, etc. that are triggered after every tick?


I think they get a chance to think every 4 ticks or something like that.