What did you find annoying/hard when you started out with this game?

  • Culture

    I'll kick off the topic! I had quite a few things that I found difficult to grasp 2 years ago, but here's a few to get started;

    • Managing what to spawn, how many and what size
    • Dealing with room edges, the flickering between 2 rooms

    What did you guys face early on? What was the most challenging for you?
    Was it waiting for energy, or was it the invaders?

    Let me know :smile:

  • I started this game a bit more than a month ago. I found the tutorial very helpful and that got me started with the basics. The biggest problem i had was that i can not code object oriented but only procedural. That's not how i am used to programming. Furthermore navigating through the files is very difficult and i still can't get the files/folders set up in a way that i find clear.

    I also miss being able to step through code when debugging. At the start console logs are good enough, but now i have a few rooms it's hard to get debug logging for the small bits that go wrong.

    As for gameplay, I still don't understand pathing. The creeps very often do not what i expect when moving to other rooms. My move to other room code does it in 4 different ways one after the other until the creep stays in the room i want it to (-: This seems to work, so i'll keep it like this for now.

    I had a lot of fun getting to understand the source keeper rooms. I still see a lot of room for improvement in what i have now, but it works good enough.

    The simultanius actions was a bit unintuitive at the start, but there is a good article about how it works, that helped a lot.

  • SUN

    For me, my biggest problem early on was when I moved from the tutorials to the public server.

    I felt like I understood the tutorial but then starting on the public server felt like an uphill struggle until I found the tutorial code and copied it in.

    Getting lab code working was a fairly major leap.

  • Background: software engineer with 26 years of experience.

    I'm not sure I understand all the tricks of the simultaneous actions system even today.

    It would be cool if this part of the API were more self-documenting in some way - i.e. I can look at the code and figure out which actions will occur.

    I will also second Dilbe's comments around debugging. Since JS is typeless, as a newbie I was often using the wrong fields and getting memory errors. Most of my early bugs were fixed once I learned how to do JSON.stringify() in the console. Maybe some sort of object viewer could be useful for newbies.

    I still don't know how to write nice OOP code in JS. My Screeps AI is a pile of spaghetti.

    So I guess in summary, if Screeps were using C# instead of JS, I would have found it a lot easier.


    One improvement that could be made is adding more code examples to the wiki. In particular, lodash has a fairly idiomatic usage pattern and having more examples of that with a screeps context would have been really helpful. Things like filtering/sorting screeps by type and hitpoints was hard when I started.

    Another improvement for newbies would be to make RoomPositions serialize into Memory out of the box.

    Another improvement would be to document the edge cases/make explicit when elements get added to Game.creeps (as a noob I expected it to happen after spawning, but it happens at the start).

  • @shedletsky if you would like to write more java/C# style classes in js you can look at the new class syntax in es6 (which the screeps version of node uses) documented here. after that tweak class syntax is mostly in line with what you would expect from other OOP languages, and you can use it as such.

    If you want to add types I would really recommend using typescript, it is written by M$ and (despite that jab) is excellent for adding on-the-go typing to a typeless language. typescript just lets you run a transpile into normal javascript but does type validation beforehand. it also has a sublime plugin which works pretty good.

    To really understand lodash and its power (and the power of alot of JS in general) I would recommend doing some research/reading on closures. especially what they mean for passing functions around (not as useful for screeps but very powerful with promises in other contexts).

  • @shockfist

    1. New class keyword - I know it exists but I haven't tried this yet.
    2. Typescript - Seems cool but at this point I would need to do a total rewrite to use it. Also not sure how easy debugging transpiled code would be. Probably a net neutral.
    3. Closures - Holy shit JS supports closures? I had no idea.

    I know promises are the hot new thing in languages like Scala.

    If they are useful in Screeps, it would be great for people like me, who know how to code, but not in JS, if the documentation showed examples. I guess my two-word feedback to OP's original question is "more examples".

  • Dev Team

    Screeps has no intention to teach you JavaScript. It's not an educational game. All examples in the tutorial and documentation aim to show you how to work with game APIs, not how to program in JavaScript and use language features. We recommend reading about it or taking a basic JavaScript course elsewhere before you start in Screeps.

    Please don't confuse this topic subject "What did you find annoying/hard in the game" with "What did you find annoying/hard in JS".

  • I think moving creeps between rooms was very confusing in the beginning. I remember learning that "all you had to do" is step on one of the exit tiles in a room and then you are transfered to the next room. This meant (to me) that I first had to locate an exit tile to the correct room i wanted to go to and only after i was transfered to the next room i could move to where i was actually going. Maybe some clarification of what functions works cross room, require vision etc could help.

  • @artch I saw this question as a "what should we fix in the new user funnel" question, since that is what I do at work. Javascript-related quirks do add some friction here and probably cause some people to churn out. Doing things like updating the tutorials to be more OOPy might start people out in a more familiar place.

    Just my 2c

  • I remember the biggest challenge was movement, especially early on when I didn't know how to move without pathing around other units. I remember designing special highways to make sure the creeps always had roads when they needed to pass each other. Then BonzAI released Traveler, and a lot of things became much clearer as I modified to fit my needs.

    Another thing is the special case of a spawning creep. A creep that is spawning has undefined TTL, so my find-filters (ie find creeps with at least 500 TTL left) caused me to spawn duplicate creeps. I still do that sometimes until i remember; "Oh, at least 500 TTL OR undefined".

    Last thing I remember was going from one to two spawns, handling orders and energy available. I still only spawn one creep each tick in each room, as calculating if I can spawn the next in queue seems such a hassle compared to just waiting a tick.

    And the last, last thing; I still mess up and get confused when looking at amount, totalAmount and remainingAmount for orders in the market.

  • To me, by far, the thing that I struggled the most with (and still do) is path finding. There are different methods of finding paths or moving along paths and they're all slightly different in terms of parameters or default behavior. The trickiest part is moving across rooms. I still don't understand the decision of treating exit tiles as portals instead of simply making them adjacent to each other. I bet that, if you show the code bellow to beginners, which didn't try moving across rooms yet, and ask what they expect to be printed on the next tick, most of them will say:

    2 [room E1N1 pos 49,24] [room E1N1 pos 49,25]

    module.exports.loop = function () {
      const {creep1, creep2} = Game.creeps;
      console.log(Game.time, creep1.pos, creep2.pos);  // 1 [room E1N1 pos 48,24] [room E1N1 pos 49,25]

    Since changing this at this point would break everyone's code, I think the best that can be done now is creating a page in the docs (together with "Gameplay" / "Scripting") about path finding and creeps' movement in general. This page could explain exactly how movement between rooms works, briefly explain the different ways of handling movement (intra and inter rooms) and give some examples. Some good examples already exist, but they are scattered around the API reference, like the example of how to combine Game.map.findRoute() and PathFinder.search().

    Also, one thing I'm still not 100% clear about is how conflicts in move intents are handled. If someone creates a page about movement, I think it would be nice if it explained that as well.

  • I've been playing this game for a week or two now. I haven't moved out of the Simulator since I want my code to be able to handle growing between rooms and fighting enemies, and I think that will be impossible to write in the live world since the tick speed is so slow.... That's actually my biggest factor in figuring out of I will continue playing this game or not. The tick speed means that once I enter the real game, development, debugging, and seeing your Screeps carry out the code will take forever. Also watching battles will be slow. I think the 5 ticks/s tick speed in the Sim is very nice. Even 2.5 ticks per second, but will I be able to stand 1 tick every 4 seconds? That's like 0.25 ticks / second...

  • @imperium Right now the tickrate on shard2 is about 2.5s which is pretty good considering that it's running 24/7, unlike the sim. You should try a private server, you can set the tickrate to anything and leave it running to compare to the real game world.

  • This post is deleted!

  • I've been around for a while, but have (relatively) recently started over from scratch trying to go with the fully automated approach, and what I have found to be incredibly annoying is the data that is available to users through the ui that isn't available to your scripts. Information on other players GLC/rooms, market data/history, being able to destroy spawns in your owned rooms, and the worst offender of all zero info on novice/respawn areas. My latest experience has shown me that screeps has an excellent api for a semi automated approach, but when it comes to full automation, it doesn't make all of the data available to you that is necessary to make informed high level decisions.

  • Very annoying was, that invaders are too strong too early. Sometimes they can't be defeated with towers at RCL below 8 and then they break walls.

    The documentation doesn't document every aspect of the game. Many details must be looked up in the screeps code. Like:

    • When do invaders spawn? (the exact algorithm is not documented)
    • Which groups of spawned invaders are possible? (the algorithm for groups of invaders is not documented)
    • If many creeps attack, move and heal each other, at which order do these things happen, when does the damage apply?

    All the answers can be found in code, but not in the documentation.

    But most annoying was, when I had a first plan to move thousands of tiny creeps with almost no CPU usage, just to find out that every intent has some insane cpu-cost of 0.2. That just changed all the strategies.

    And still annoying is, that the UI cannot cancel, destroy or kill more than one construction site, building or creep per tick.

  • Culture

    It seems like most of the invader docs you want are here.

    • When do invaders spawn? (the exact algorithm is not documented)

    Every room where energy is mined has an inner counter at approximately 100,000 units of mined energy (plus some random variable). After this counter times out, a new game-controlled creep appears at one of the room exits with the goal of hunting your creeps.

    • Which groups of spawned invaders are possible? (the algorithm for groups of invaders is not documented)

    There is a 10% chance that you will get not only a lone Invader but a whole company of them, from 2 to 5. Each Invader has its own role: melee attacker, ranged attacker, or healer. Ranged attackers are different from melee ones in their behavior: they try to stay at a distance from your creeps. The function of healers is evidently to heal other raid members. Also, some creeps may be boosted with , , , or .

Log in to reply

Looks like your connection to Screeps Forum was lost, please wait while we try to reconnect.