Git Product home page Git Product logo

Comments (4)

Abstrct avatar Abstrct commented on August 16, 2024

When I started to write the Schemaverse, there actually wasn't any fleet scripts, instead each ship had a ship_script. Then folks came along and made 40,000 ships and, as you can imagine, the tic system basically came to a halt.

A,B & C) Right now each ship does have the ability to hold a 'state' where you can say MINE this PLANET, basically until you give it a new command. This way, it doesn't have to look around it's locations each time and decide to mine that specific planet because it is closest. The other two states you can choose are ATTACK, SHIP and REPAIR, SHIP.

I think it is up to you as the player to use your fleet scrip time accordingly to monitor the surroundings and change these states as you see fit. Maybe you don't' always have time to change the state of every ship in your fleet each tic but I think there is some fun game mechanics in that. Maybe other players could chime in here and say their own thoughts on the matter too?

D) This is also slightly in play already, right now you can have a MAX_SPEED that is greater then the allowed MAX_FUEL. In order to climb to that speed, you need to set your target speed to MAX_SPEED and then refuel your ship repeatedly throughout it's trip. Similarly, once you start getting close to your destination, you need to start refuelling again repeatedly so you can slow down in time. I think it is aspects like this that would make script writing interesting so I am hesitant about automating this. But, again, I am certainly willing to hear everyones thoughts on this as well.

from schemaverse.

JackOfMostTrades avatar JackOfMostTrades commented on August 16, 2024

Hmm, I actually hadn't realized you could already do A,B,C (although it's fairly clear once you look at tic.pl). Is setting action and action_target_id explicitly mentioned somewhere (I wouldn't be surprised if I missed it when I was first learning).

D) I think basically I agree with Abstrct on this. There's already problems to solve and optimize with respect to ship movement / acceleration / speed. The new movement system will slow you down when you get near your destination, but if you're going faster than you can slow down in a single tic (because MAX_FUEL is the limiting factor in your acceleration) you're still going to end up over-shooting. You could make an argument that this should be factored into the MOVE_SHIPS() backend method, but I think it's actually an interesting discrete math / engineering / optimization problem for players to solve.

from schemaverse.

cbbrowne avatar cbbrowne commented on August 16, 2024

I was thinking a bit more last night about the BURN notion, and I think I have an improvement in this regard to consider...

Was thinking about how to head to a desired destination. What's wanted is generally to get from point A to point B and, upon reaching point B, have velocity of 0.

I was thinking about having this take place via continuous burn rather than the present "get up to speed" then "stop when you get there."

Thus, the notion would be that the control is "burn N units of fuel per turn 'towards' the destination." But that's an oversimplification... Split that burn into two pieces:

a) How much of the burn is used to shift velocity to point directly at the destination? That will involve taking a tangent vector to the difference between current velocity and current destination, and using whatever portion is needed (perhaps 100%!) to shift the velocity vector to the same direction as the direction vector.

If present velocity is 0, or the ship is heading directly towards the destination, then this portion of the burn is 0. If you change destinations, the portion might be 100% for a number of turns.

b) Now, if there is burn left over after adjusting the velocity to match the destination, then the remainder of the burn may be used to either:

i) Accelerate towards the destination, or
ii) Decelerate, to slow towards a stop

Now, mumble, mumble, Optimal Control Theory, mumble, mumble, Pontryagin's Minimum Principle, this is a bang-bang control, with either maximum acceleration or deceleration, depending on whether, at maximum deceleration, you'd stop short of the target or not. (Should be able to work out a polynomial approximation for that, and get at least 'pretty close.')

I'd like to throw in an extra change, namely to allow some low burn rate to be considered free of charge. The "science fictiony" justification would be that the ship has a built-in ion drive that can support 10 units of acceleration per tic without consuming any fuel. That gives a good reason to do continuous low rate burns, if it's cheap to do so. In addition, I'd be inclined to eliminate MAX_SPEED as a constraint.

Methinks it's much more interesting to have fleets of ships doing 10 unit/tic burns that get them up to enormous void-crossing speeds. Makes me think of a Known Space torch ship. (And fleets of Pak Protectors...)

There's something of an illogic to being able to refuel any ship, anywhere.

from schemaverse.

JackOfMostTrades avatar JackOfMostTrades commented on August 16, 2024

I think I see the point you're making and a lot of it crossed my mind when I reworked movement recently. At the time I stuck with what's there now since it seemed like we ought to just start by fixing existing movement and then can consider new versions.

It sounds like you're general idea is that you'd want to define a ship's control by its daily (I'm going to just refer to our one-tic-of-time as a day) acceleration. So if you need to do a course correction or are less than half way to your target, you're still accelerating by that amount, and otherwise you need to start decelerating in order to stop in time. Makes sense to me so far.

But here's the catch. Suppose you want your ship to travel from (0,0) to (0,1000) at a constant acceleration of 10. This would end up taking (... gets some paper and does calculus ...) roughly 16 days and so you would have used 160 units of fuel. Now suppose instead I spend one day accelerating at 80, cruise at speed 80, and then spend one day decelerating at 80 to stop. I would have traveled the same distance using the same amount of fuel, but it would only take 13 days. This is why it seems to me like a target cruising speed is a better parameter to work with.

(By the way, the best time to start decelerating can be found by solving a kinematic equation for constant acceleration which is quadratic so yields a reasonable solution. You just need to do a bit of rounding since we're using discrete time units. But I can go into that later; I've clearly spent some time thinking about it.)

I'd agree that MAX_SPEED doesn't really make sense in this context, so I'd throw a vote behind getting rid of that. Instead what I think would make more sense is to have a MAX_ACCELERATION, which we more or less do already via MAX_FUEL (since the amount you can accelerate in a single tic is limited by the current fuel). In this case you could probably just eliminate each ship having its own fuel count, since I'm not sure if there's any utility to that (I certainly just refuel all my ships every turn, so any fuel cost is effectively just pulled from my player fuel reserve anyway).

Final comment on the free 10 units of acceleration: I don't personally have strong feelings one way or another about that, but I have to say that 10 units isn't really enough to make a difference in the game as it is. The average minimum distance between two distinct planets is around 250,000 (yes of course I calculated that. How else would I determine the typical optimal ... nevermind), so at 10 units of acceleration it would take about 4,167 tics to get from one planet to another. Since I think rounds have been around 2000 tics (rough guess) you wouldn't even get to the point where you start slowing down... and that's just to get to one more planet. So you'd probably have to up the free value (in which case would we be giving too much away for free?) or else it seems like it'd be moot.

from schemaverse.

Related Issues (20)

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.