Code Monkey home page Code Monkey logo

docs's Introduction

This project contains the sources of the documentation web site for Screeps online game.

You need to have Node.js in order to build this project.

  1. Install all npm dependendcies:
npm install
cd api
npm install
cd ..
  1. Generate static site:
npm run generate
cd api
npm run generate
cd ..

You can use generate-watch instead of generate to sync changes in real time.

  1. Run development server:
npm run server

docs's People

Contributors

artch avatar bannmann avatar cp4r3z avatar creosteanu avatar daboross avatar dmitriyff avatar enr-beck avatar exav avatar helam24 avatar hiryus avatar ityper avatar jbyoshi avatar kevindewit avatar kyberprizrak avatar lf- avatar mnuck avatar nxtn avatar o4kapuk avatar pzyckoh avatar riftlurker avatar selareid avatar spedwards avatar subodai avatar syluximmortal avatar tedivm avatar thijsray avatar tylermarques avatar wolfwings avatar wtfrank avatar zyzyzyryxy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docs's Issues

heuristicWeight info on docs is incorrect

Summary

At both occurences in the API reference, heuristicWeight is said to be 1.2 per default.
You can see this at:

However, the default is actually 1.0.

Engine showing the default is 1.0

https://github.com/screeps/driver/blob/master/lib/runtime/path-finder.js#L68

Trial showing the default is 1.0

const start = new RoomPosition(38, 6, "W1N4"); 
const stop = new RoomPosition(8, 41, "W1N4"); 
const { ops, cost, incomplete } = PathFinder.search(start, stop, {range: 0, maxOps: 10000 }); 
const tmp = { ops, cost, incomplete }; 
console.log(JSON.stringify(tmp))

// No heuristicWeight opt configured
// => [2:28:41 PM] [shard3]{"ops":78,"cost":41,"incomplete":false}
 
const { ops, cost, incomplete } = PathFinder.search(start, stop, {range: 0, maxOps: 10000, heuristicWeight: 1.2 }); 
const tmp = { ops, cost, incomplete }; 
console.log(JSON.stringify(tmp))

// If default is 1.2, this should be the same as above. It's not.
// => [2:28:52 PM] [shard3]{"ops":62,"cost":41,"incomplete":false}
 
const { ops, cost, incomplete } = PathFinder.search(start, stop, {range: 0, maxOps: 10000, heuristicWeight: 1.0 }); 
const tmp = { ops, cost, incomplete }; 
console.log(JSON.stringify(tmp))

// heuristicWeight 1.0 matches the call without this opt
// => [2:28:59 PM] [shard3]{"ops":78,"cost":41,"incomplete":false}```

[Suggestion] Next, Prev replaced by the name of the page?

Just a small suggestion, but started with reading the "Introduction" page. in the bottom i noticed next and prev, although i would rather see which subject my next page would be!

for instance instead of "Next" -> "Next - Example" or -> ">/Example"

Feel free to make sub suggestions or criticize about my statement.

Clarify that PathFinder is enabled by default

The PathFinder module became enabled-by-default in 2016. However, the API documentation for PathFinder does not say so. PathFinder.use is still presented as if it enables an optional feature---now a deprecated optional feature.

I would suggest adding a sentence to the PathFinder module header:

This module exports the path-finding algorithm used internally by Creep.moveTo and other methods. It can be disabled to use an older, slower algorithm (although doing so is not recommended).

And a sentence to PathFinder.use:

PathFinder is enabled by default. This method can be used to disable or re-enable it.

And adjust the wording of places that reference PathFinder, such as Room.findPath:

This is only used when the new PathFinder is enabled. This option is ignored if PathFinder has been disabled.

This option cannot be used when the new PathFinder is enabled (use costCallback option instead). This option can only be used if PathFinder has been disabled. If PathFinder is enabled (which is the default), use the costCallback option instead.

Missing Game.market.createOrder signature

In-game console suggestion shows this function as:

function(string type, string resourceType, number price, number totalAmount, string roomName) -> number

API docs mention another signature where all arguments are packed into an object:

function(object params) -> number

It seems both can be used but first one is missing in docs.

Creep.moveByPath incompatible with path returned by PathFinder.Search

This is incorrect:

A path value as returned from <a href="#Room.findPath"><code>Room.findPath</code></a>, <a href="#RoomPosition.findPathTo"><code>RoomPosition.findPathTo</code></a>, or <a href="#PathFinder.search"><code>PathFinder.search</code></a> methods. Both array form and serialized string form are accepted.

Creep.moveByPath is unable to accept an array of RoomPosition objects returned by PathFinder.search

Ideally, fix the bug; at least fix the doc to match current state.

Interesting Facts That Makes Euro Truck Simulator The Best

Reals Facts That Make Euro Truck Simulator(ETS) The Best Gaming Simulator

  1. GRAPHICS
    The meticulous attention to detail in re-creating actual areas is an intriguing aspect of Euro Truck Simulator's aesthetics. SCS Software, the game's creators, uses a method called "photogrammetry" to take pictures of actual terrain and items, which are then incorporated into the game's virtual world. Highly realistic surroundings for roads, buildings, and landscapes are made possible by this approach. Players can thus experience an immersive driving environment while navigating European roads, complete with realistic graphical features.

  2. MODS
    The fact that Euro Truck Simulator has a committed and passionate modding community is an intriguing feature of the game. A vast range of custom mods made by players, such as new trucks, trailers, maps, and gameplay mechanics, have greatly expanded and improved the game. This degree of player participation in the community has helped the game maintain its popularity and replay value.

  3. REQUIREMENTS
    The low system requirements of Euro Truck Simulator make it playable on a variety of computer configurations. Here are a few intriguing details about using these systems to play the game:
    Sample of Some Low Required Spec
    • CPU: 2.4 GHz Intel Pentium 4 or equivalent and 1.10GHz Intel Celeron.
    • CPU SPEED: 1.10 GHz
    • RAM: 512 Mb (Windows XP) 1 GB (Windows Vista)
    • VIDEO CARD: GeForce 4 (not MX!) or better, ATI Radeon 8500 and other.
    • DEDICATED VIDEO RAM: 128 MB
    • PIXEL SHADER: 1.3
    • VERTEX SHADER: 1.3
    • OS: Windows XP or Windows Vista
    • FREE DISK SPACE: 5GB
    • SOUND CARD: Yes

• Euro Truck Simulator is well-optimized for PCs with minimal specifications. The game's designers have worked hard to make sure that it can operate properly on even older machines with basic hardware, enabling a larger audience to enjoy the simulation experience.
• Scalability: The game offers a number of visual options that can be modified to fit your PC's capability. This scalability makes it possible for players to strike the ideal mix between visual fidelity and performance, making it playable on PCs with lower hardware.
These factors have contributed to Euro Truck Simulator's popularity among gamers with older or budget-friendly computers, as it offers an enjoyable gaming experience even on less powerful hardware.

  1. CAMERA
    To improve the gaming experience, Euro Truck Simulator offers a choice of camera options. Here are some interesting facts about its camera capabilities:

  2. Multiple Camera Views: Euro Truck Simulator offers a variety of camera views, including the typical third-person view from a distance and even a free-roaming camera. Due to the variety, gamers can select the viewpoint that best suits their preferences and playing style.

  3. The game's interior camera perspective is extremely detailed, with perfectly recreated truck cabins. The complex dashboard displays, functional indicators, and even the genuine steering wheel action may be appreciated by players, adding to the immersion.

  4. Customizable Camera Controls: In Euro Truck Simulator, players can adjust the sensitivity and mouse/keyboard mapping for their camera controls. This adaptability enables players to customize the camera positioning to their preferences, which enhances the comfort and enjoyment of the game experience.

  5. Cinematic Camera option: The game also features a cinematic camera option that enables users to take breath-taking screenshots and in-game video. The Euro Truck Simulator community has produced some fantastic films and pictures as a result of this feature.

  6. VR Support: The use of virtual reality (VR) headsets with Euro Truck Simulator makes the game even more immersive. To increase the sensation of realism and presence, players can wear VR headsets to make themselves feel as though they are actually inside the truck's cabin.

These camera-associated capabilities

  1. CONTROLS
    There are many different control settings available in Euro Truck Simulator. The following are some fascinating details about its controls:

  2. Wheel and Pedal Support: One of Euro Truck Simulator's best features is its outstanding support for various steering wheels and pedal configurations. A very realistic driving experience is provided through the employment of realistic hardware by players to control their trucks.

  3. "Haptic Feedback": Numerous steering wheel configurations for Euro Truck Simulator also have "force feedback" or "haptic feedback." With the use of this technology, gamers can mimic rumbling over various terrains while also feeling the weight of the truck and the road surface.

  4. Key Mapping Customization: The game lets players completely alter how their control assignments are displayed. Since you may arrange your keyboard, mouse, joystick, or gamepad however you choose, it can be used with a variety of input devices.

  5. Multi-Monitor Support: Euro Truck Simulator supports multi-monitor configurations, giving players a wider, more immersive perspective of the road. Fans of simulation are particularly fond of this aspect.

  6. Console Controller Support: Euro Truck Simulator, a PC game at first, is now playable on PlayStation and Xbox gaming consoles. Because it supports controllers, users of various platforms can enjoy the game using their preferred input method.

  7. User-Defined Dead Zones: The game allows you to choose dead zones for your controls, giving you precise control over steering and sensitivity. For you to customize your driving experience, this is essential.

  8. Mouse Steering: Euro Truck Simulator has a different control method dubbed "mouse steering," in which users can direct the truck's movement using their mouse. For those who favor it, it's an unique approach of playing the game.

Whether a player prefers a casual experience with a controller or a highly realistic one with a full wheel and pedal setup, these control-related features help make Euro Truck Simulator accessible and popular to a wide range of gamers.

dark mode theme support for docs

Can we have a dark mode on the docs?

Here is something I've been playing around with. I am a css amateur, so I will assume you will work out the issues but otherwise, here is the bulk of the work:

image

@media(prefers-color-scheme: dark) {
	body {
		color: #f5f7f9;
		background: #171f26;
	}
	#header-main {
		background: #171f26;
	}
	#header {
		background: #171f26;
	}
	#logo-docs {
		color: #9fa1ad;
	}
	.sidebar-link,
	.toc-link {
		color: #aaa;
	}
	#content-inner {
		background: #171f26;
	}
	#article-toc-top {
		color: #fff;
	}
	#article-toc-top:hover {
		color: #1094e8;
	}
	.article-title {
		color: #fff;
	}
	.article-content {
		color: #bbb;
	}
	.article-content blockquote {
		border: 1px solid #aaa;
		border-left: 5px solid #aaa;
		background: #333;
	}
	.article-content table {
		border: 1px solid #e3e3e3;
	}
	.article-content table tr:nth-child(2n) {
		background: #eee;
	}
	.article-footer {
		border-top: 1px solid #e3e3e3;
		color: #999;
	}
	#mobile-nav {
		background: #171f26;
	}
	.mobile-nav-toggle-bar {
		background: #aaa;
	}
	.mobile-nav-link {
		color: #aaa;
	}
	.mobile-nav-title {
		color: #666;
	}
	pre,
	code {
        color: #fff;
		background: #555;
	}
	#logo-wrap {
        background: #4f536d;
        border-radius: 10px;
    }
}

[Improvement] Creep.getActiveBodyparts CPU cost correction

The CPU cost of Creep.getActiveBodyparts should be "low" instead of "insignificant". Here's my reason.
Went for the engine and found that the actual codes of Creep.getActiveBodyparts is down below,

function _getActiveBodyparts(body, type) {
    var count = 0;
    for(var i = body.length-1; i>=0; i--) {
        if (body[i].hits <= 0)
            break;
        if (body[i].type === type)
            count++;
    }
    return count;
}

This loop can run up to 50 times in total, which may be a little costy and should not be "insignificant". And also, this result is not cached, which is worth noting in the api.
Spotted this problem after using a lot Creep.getActiveBodyparts and it ended up being the most CPU-costing in screeps-profiler.
I'm not a native English speaker, please excuse my grammar mistakes.

[Suggestion] Dark, White and Blue theme

I personally prefer the dark theme.

although some arg that white theme has better readability, make it so people can switch between themes, while keeping white theme default?

Feel free to make sub suggestions or criticize about my statement.

Multilingual support?

Is it possible to make the site multilingual so we can contribute translations rather than fork and deploy my own?

Improve RoomPosition.findClosestBy*() Doc Clarity

RoomPosition.findClosestByPath(type, [opts]) will look for objects in the same room and RoomPosition.findClosestByPath(objects, [opts]) will check all objects passed in.
However, RoomPosition.findClosestByRange(objects, [opts]) will only check for objects in the same room, ignoring any objects in other rooms, which is inconsistent with the previous method.
Would you add some clarification about this in the api?

Text to Talk is Broken

When using macOS' text-to-talk accessibility feature, it just says "Capitol P" no matter what selection you give it.

Indication of what methods cost

In the new API docs, there is a notable omission of the cost to run a given method. This is rather important to writing AIs that are efficient.

Misleading ticksToLive property description on StructureWall

http://docs.screeps.com/api/#StructureWall.ticksToLive

Reading this I thought that all novice area / respawn area walls would have that property and so I would distinguish them from "regular" walls by this.
Lately I found out that there were some "starting walls" created instead of safemode when a player spawned and this probably refers to those.

Since as far as I know there are no starting walls now, and no walls ever get this property, it should probably be removed from the docs.

I'd also like to see some remark (on http://docs.screeps.com/api/#StructureWall.hits or on http://docs.screeps.com/api/#StructureWall) stating that for novice/respawn area walls won't have hits property.

OBSTACLE_OBJECT_TYPES is outdated

#ingame
OBSTACLE_OBJECT_TYPES
spawn,creep,source,mineral,controller,constructedWall,extension,link,storage,tower,observer,powerSpawn,powerBank,lab,terminal,nuker

#from docs
OBSTACLE_OBJECT_TYPES: ["spawn", "creep", "wall", "source", "constructedWall", "extension", "link", "storage", "tower", "observer", "powerSpawn", "powerBank", "lab", "terminal","nuker"],

a proplem

https://docs.screeps.com/contributed/modifying-prototypes.html

In set and get methods, "memory.sources" is different from "memory.sourceIds"

Object.defineProperty(Room.prototype, 'sources', {
    get: function() {
            // If we dont have the value stored locally
        if (!this._sources) {
                // If we dont have the value stored in memory
            if (!this.memory.sourceIds) {
                    // Find the sources and store their id's in memory, 
                    // NOT the full objects
                this.memory.sourceIds = this.find(FIND_SOURCES)
                                        .map(source => source.id);
            }
            // Get the source objects from the id's in memory and store them locally
            this._sources = this.memory.sourceIds.map(id => Game.getObjectById(id));//this
        }
        // return the locally stored value
        return this._sources;
    },
    set: function(newValue) {
        // when storing in memory you will want to change the setter
        // to set the memory value as well as the local value
        this.memory.sources = newValue.map(source => source.id);//this
        this._sources = newValue;
    },
    enumerable: false,
    configurable: true
});

I think there's an overnight "reset" that isn't documented.

Hi, so I have a funny situation that Reddit helped me debug.

I read about the "global object wipe" thing that happens every tick.

any changes in these properties, appearing of new objects, and dismantling of old ones will happen only at the start of the next tick

That makes sense, and is something I have been keeping in mind. But my bug was different, and came about from the following situation:

// main.js
var spawn = Game.spawns.MySpawn;
module.exports = function() {
    // ...
    if (spawn.spawning) {
        // do nothing this tick
    }
    // ...
};

As you can see, var spawn is generated at compile time, which I thought would be more efficient. My code worked perfectly during the day, from morning til midnight. But overnight, my code would stop working. spawn.spawning would be stuck returning whatever it was returning at some point when I wasn't looking. If I changed any line of any file, it would start working, because main.js would get recompiled!

I believe that overnight, the Game object is recreated, such that Game.spawns.mySpawn is a new object. This means that var spawn is still pointing to the old object, which never gets updated, breaking my colony.

The fix was to do this:

module.exports = function() {
    var spawn = Game.spawns.MySpawn;
    // ...
};

It took a post on Reddit to debug this because I had no idea that the Game.spawns object would be repopulated with new data at some point overnight. I don't think this is documented, and if it is, I have still not read that document - and since it was the first line of code I wrote after the tutorial, I think it should be put early in the documentation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.