Anuken / Mindustry-Suggestions

Repository for Mindustry suggestions and feedback
131 stars 58 forks source link

Jumps to a variable location and no-ops in mlog #5322

Closed Mnem42 closed 1 week ago

Mnem42 commented 1 week ago

Describe the content or mechanics you are proposing.

Making the jump instruction have an option to take a numerical variable as an input (and jumps forward by that many lines), or make another njump instruction to do that, and add no-ops to make it more useful as a feature.

Describe how you think this content will improve the game. If you're proposing new content, mention how it may add more gameplay options or how it will fill a new niche.

It allows if else statements based on a numerical value to be more efficient and readable, because it only has to check one jump command after a small amount of math to adjust the number as needed.

No ops are useful for aligning each option in some cases (e.g. one branch takes one or two more instructions), and shouldn't take a tick, because the wait instruction already exists to use up CPU time. A print statement can be abused to do the same thing, but it takes an extra tick and isn't very good for semantics (nop has a more clear intention than print ""). There can also be an nnop command that inserts n mops before the code is run (nnop 3 rather than nop nop nop).

This feature is useful for things like mlog GPUs, for decoding each command efficiently.

Before making this issue, check the boxes below to confirm that you have acknowledged them.

camelStyleUser commented 1 week ago

pov:noop pov:@counter

camelStyleUser commented 1 week ago

yes noop is text only

camelStyleUser commented 1 week ago

you should be using text at this point anyway

Mnem42 commented 1 week ago

pov:noop pov:@counter

Yup, i'm dumb

Mnem42 commented 1 week ago

Closed

Mnem42 commented 1 week ago

you should be using text at this point anyway

Late, but I do that. Just forgot that counter was settable, and forgot about no-ops.