CRPL and ore

Started by Builder17, March 07, 2016, 11:54:42 AM

Previous topic - Next topic

Builder17

There isn't any commands to make CRPL core request ore , any way to cheat in it?

Nicant

#1
I've tried to do this in the past, and i found out CRPL Cores cannot request ore. To bypass this, I tried using "Fake" Packets that travel between collectors to it's desired place. I would put an invisible Core under each ore deposit that would check if there was an ore mine built on top of it and if there was, it would produce the "fake" Packets. Unfortunately, I am not an expert at CRPL so i never really accomplished that. (As you saw with my Mystery units in my "Sleeper Warzone" map.) If you or anyone finds a way to have fake packets, let me know because i have some very cool/game changing ideas!

Hopefully this sparks new ideas/helps! :)
CW4 hype!!

Vanguard

Hmm, is it terribly important that it has to be ore? Maybe just using AC does the trick as well?

What is the reason that it has to be ore?


Vanguard

#3
Quote from: Builder17 on March 07, 2016, 11:54:42 AM
There isn't any commands to make CRPL core request ore , any way to cheat in it?

Quote from: Nicant on March 07, 2016, 03:34:47 PM
If you or anyone finds a way to have fake packets, let me know because i have some very cool/game changing ideas!

Let´s think this through in theory, because I find it tantalizing.

1) Have a core.
2) Have another core. Since the attribute to request orepackets is not in the core-engine, we need to work around this.
3) Crate a unit with the image of an orepacket´+siphon/oredeposit+oremine at core 2.
4) Write an Algorithm for the pathing of the packet to core 1.
5) Queue move commands for the newly created ore packet-unit from core2 to core1.
6) When no more queued commands, destroy the unit and add one ammo to core1.
7) make sure the pathing algorithm can detect broken networks and will stop packets from being sent out, if so.

Should, in theory, be doable.

If I get more time, after all my other projects, I´ll try to code that. If somebody gets to it before me, let me know, so I can do other stuff  :-*

J

Quote from: Vanguard on March 21, 2016, 09:33:34 AM
1) Have a core.
2) Have another core. Since the attribute to request orepackets is not in the core-engine, we need to work around this.
3) Crate a unit with the image of an orepacket´+siphon/oredeposit+oremine at core 2.
4) Write an Algorithm for the pathing of the packet to core 1.
5) Queue move commands for the newly created ore packet-unit from core2 to core1.
6) When no more queued commands, destroy the unit and add one ammo to core1.
7) make sure the pathing algorithm can detect broken networks and will stop packets from being sent out, if so.
Something that has been asked many, many times and none of the great coders have ever implemented it. 4 and 7 will be very hard to code and might be very slow if not implemented is a highly optimised way. Unless you get a proper idea to make that algorithm work, the rest is useless. Anyways, here's my try (without 7):
1. Search all units and put them in a list, including their coordinates.
2. Build a proper graph using a linked list method (where each list is two or three items long and contains an UID (or coords+unittype) and/or one or two more lists (or references to another list)). Too hard to explain for now. Make sure to keep things organised! Using a 2D array to build the graph is almost impossible to handle as new units are built and others are destroyed, old entries must be properly removed to keep the memory usage reasonable.
3. With that graph you should be able to use dijkstra's algorithm
4. Save the route in case you want to send more packets within a few seconds

This should prevent using GetUnitsInRange at every unit's location, as you can do a check yourself using the Distance CRPL command. Every now and then, you should update the list with all new units or when the old route is broken.

Perhaps someone should create another topic on our quest to a pathfinding algorithm. Basically it's simulating some of the core mechanics of the game within that same game. Crazy.

Builder17


Vanguard

Quote from: J on March 21, 2016, 01:02:33 PM
Perhaps someone should create another topic on our quest to a pathfinding algorithm. Basically it's simulating some of the core mechanics of the game within that same game. Crazy.
Reinventing the wheel!  ;D