Jump to content
  • Advertisement

Toolmaker

Member
  • Content count

    5008
  • Joined

  • Last visited

Community Reputation

967 Good

About Toolmaker

  • Rank
    Legend
  1. Toolmaker

    Anyone tried Screeps, the MMO for programmers?

    So, anyone still playing but me? I scrolled around the map to find any of you but couldn't find your room and looking by the ranking it seems your AIs have been obliterated and never respawned.    Over the past week I kinda came to the conclusion that I tried to solve too many issues at the same time in code. I wanted to automatically build miners, balance trucks, find the most ideal energy distribution scheme, build creeps based upon the amount of energy in store combined with production statistics and threat level. So I ended up with a big ball of clutter that tried to do everything and failed at it all.   So I took a tinsy detour and refactored the whole thing into a message based system where each message would pretty much just do 1 thing(heh, turns out SRP isn't such a bad idea after all) and the AI executes message by message, measures the amount of time left and if CPU is about to run out it will cease message processing. Much more robust and turns out, much easier to develop as well. Most things are still done manually: if I want to mine a source I have to issue a command and the AI will then spawn a builder and trucks for it but with these basic commands I can start building more complex ones and then a decision making module that will trigger.
  2. Toolmaker

    How many of you write self-documenting code?

    I'm not sure why most programmers seem to be doing this but it is a wide-spread phenoma. Robert C. Martin goes into the subject in 'Clean Code' (which in my opinion should be standarized reading material for EVERY and ALL programmers which they should re-read every one or two years).   I've ran into these issues at my current job more than once and over there it is a cultural thing. Many of my colleagues find that writing three letter variables is less work(because hey, intellisense isn't there to autocomplete it the first time you write it out) and prefer to write everything according to the hungarian misnotation. The result is a mix of incredibly unreadable code, mixed in with prefixes such as int, dbl, bln on variables are all different types(in many cases not even the type declared in the variable name) with sometimes a line of comment above each regular line of code, such as: // loop over all the items in the list for (var objItem in lstItems) { // do something with objItem DoSomething(objItem); // Transfer into the list of processed items lstProcessedItems.Add(objItem); } What I've seen in my work is that the more people stick to basic guidelines such as the Single Responsiblity Principle(SRP) and the like the more likely they are to also write self-documenting code. The more you mix different aspects together the less easy it becomes to write code that documents itself because boundaries become fuzzy and naming isn't as exact and simple as when an object or a method does only one thing.   I do agree with single letter variables are a big no-no unless you're using Linq(Where(o => o != null) is as readable as Where(theObject => theObject != null)), loop-variables to signify index or loop values.   But in the end: since every book or tutorial seems to abbreviate things it is what you learn first. And first habits are easily becoming engrained as the norm.
  3. Toolmaker

    Anyone tried Screeps, the MMO for programmers?

    There are solutions around the debugging which can mostly be found in the form of unit tests. You use run them using node.js combined with a unit testing framework. Write a bunch of mocks for game functionality you want to test and viola. It will of course be more work to build stuff but at least you know it checks out when you put it in production.   I think once you have a basic framework covering production, construction and planning the game becomes more about strategy.
  4. Toolmaker

    Anyone tried Screeps, the MMO for programmers?

    I think alliances are inevitable in the game, you simply can't take on everyone at the same time as you'd probably have to defend from various attackers simultaneously. Of course, that might be a pretty interesting game to watch I suppose.   So, what strategies are being taken when it comes to building creeps? I currently just take the amount of available energy into account and build new creeps based on that. Still using mostly statics bodies.
  5. Toolmaker

    Anyone tried Screeps, the MMO for programmers?

    I use dedicated creeps too. Like most, I have miners that mine and trucks that pick up any energy and deliver them to builders or structures. Trucks have a dedicated pickup location but dynamic dropoffs. For dropoffs I use spatial map in which consumers report their demands along with a priority. Structures always get precedent over builders so that I can keep spawning before building things. It took a while to get working and tweaked properly but it works pretty nicely.   Currently working on a spawn system that takes average energy production and number of extensions into account and also plans on which creeps to replace with which. I've had a few hickups where all creeps died quickly after eachother, clogged up the build queue with the wrong creeps and ended up in a coma. It happens less and though, which is kinda nice.   After that, I think I'll implement soldier logic to hunt down source keepers and construction logic to build ramparts after which I think I got all the basics in for an AI that can sustain a room by itself and then start on expanding/combat.
  6. Toolmaker

    Anyone tried Screeps, the MMO for programmers?

    The initial investment is rather steep if you ask me because you do need to churn out a basic AI that is capable of doing collecting resources, defending the room, constructing various structures, distributing energy across the spawns, extensions and workers. However, once you have the basic behaviors in it is a matter of fine tuning and giving orders.   It takes time to take control of new rooms, especially rooms taken by other players. But even if rooms were already empty, it takes time to construct buildings, upgrade the controller and ensure its defendable. So all in all, once you have the basic decision making in it should be pretty much capable of taking care of itself unattended. But that still requires quite a lot of time on short notice. I found that getting the hang of Javascript took me a while and all the code I wrote along the way needs some pretty major refactoring in order to get it into a better shape.
  7. Toolmaker

    Anyone tried Screeps, the MMO for programmers?

      I hope you get well soon!
  8. Toolmaker

    Anyone tried Screeps, the MMO for programmers?

    Done. You have received my final Early Access Preview code. Let me know which room you're all in, I'd love to see how others are better than me :P.
  9. Toolmaker

    Anyone tried Screeps, the MMO for programmers?

    I'm playing under the same name as my GDNet account: Toolmaker. I'm located in room W13S11, which is in the bottom left corner of the map. At the moment my AI doesn't do very much, haven't had a lot of free time.   I did completely revamp the system to keep track of energy needs over the weekend. Re-factored it into a spatial map and ensure that extensions would be properly served, which isn't the case in the current implementation. Still need to find some time to actually test it and put it in production so I can finally construct creeps with more body parts and thus create soldiers to mine the two guarded sources in my room. And I really need to write code to construct more defenses in my room, such as ramparts blocking the exits.   Dragonsoulj: I'll PM you one access code.   Got one more left(actually had three instead of the advertised two).
  10. Toolmaker

    Anyone tried Screeps, the MMO for programmers?

    I don't think it is possible to call code from outside the sandbox. I've seen a few error stacktraces that mentions lodash's runInContext(), so I strongly doubt that you can even access code or memory from outside said context.   That being said, its possible to add any library you'd like to include as long as it doesn't rely on external bindings. There are limitations, such as the game doesn't appear to have any folders. My source on disk is divided up into folders but after uploading with Grunt it is all flattened which can be tricky in larger projects.   I still have an Early Access code available, gave one out to slicer4ever via a PM.
  11. Back in november I stumbled upon the crowdfunding of Screeps, a massive multiplayer online game designed for programmers. It is a strategy game where you do not play but program an AI to play for you. I decided to throw in some money because it made me excited and as a result I've been toying around for the past several weeks in the early access preview.   And I must admit that I quite like it. It is challenging: the game provides the basic game mechanics and functionality such as path finding and examing the playing field and manipulating it and the rest is up to the programmer. Basic things, like building a unit that collects energy or one that picks up energy from a creep that is mining for energy and bringing it to unit that needs it are quite simple. But once you have more than a few creeps things start needing coordination and it gets more complex.   I think this might also be a very good way to learn game programming: the game has a tick based architecture and in order to keeps things efficient you need to figure out a way to keep track of resources, overall state units and rooms. In the few sessions I've spent on the game I had to dive into some algorithms(implemented a breadth-search for finding suitable construction area), data structures(currently researching spatial hashing to group together local energy needs) and working out how to keep the game running efficiently.   I also happen to have two additional tokens for use in the early access preview. If anyone is interested I'd to happy to share them on first-come basis. However, please think about if you're actually gonna play or just want to check it out and abandon it. There are quite a few players who's AI seem starved, unresponsive and stuck without being updated and it would be a shame if my tokens would be used in such a fashion too. If you do want to try it out for a bit, it has a built-in code editor and a partial simulation that runs in the browser under simulation, where also the tutorial can be found.   If anyone's playing: I'd love to hear other experiences.
  12. Toolmaker

    Untitled

    The correct name would be "Straftanz"
  13. Toolmaker

    Untitled

    I think all their shows are the same, because I saw the same show last friday in Eindhoven. 2nd last Beloved, ending with Perpetual and going on with "Let there be, let there aaaalwaaays be, never ending light". But their performance was pretty good, and a bunch of dudes gave them a pair of clogs, which was pretty cool. Too bad VNV hardly performs in the Netherlands.
  14. Toolmaker

    Untitled

    So... What's new about you shitting everywhere?
  15. Toolmaker

    Untitled

    You should take a photography course, you're photo is kinda blurry ^_^
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!