[MOD 0.12.32] Prospect

Topics and discussion about specific mods
Finndibaenn
Long Handed Inserter
Long Handed Inserter
Posts: 55
Joined: Fri Feb 21, 2014 8:53 pm
Contact:

[MOD 0.12.32] Prospect

Post by Finndibaenn »

Hi,


after having enjoyed some of the wonderful mods that i found here (Bob's, Dytech's, Treefarm, RSO, FARL, ResourceMonitor to only name a few), i've tried to make one too, starting from my experience in my recent game with RSO and Bob.
I found that ores were too abundant and too close (no need to expand very much), BUT when i was looking for Rutile, I didn't find it fun running around for maybe 30 min or 1 h withough finding anything.

So ... I made a mod that allows one to build Geology Lab, able to produce "ore maps" for a given ore. Gameplay wise, this is achieved using a ResourceMonitor inspired GUI that displays direction and distance of surveyed deposits.

The mod currently works, eg, allows to track deposits , but all resource costs are still placeholders, as are graphics (taken from recycling mod).

The source code is on github, release is available here

The mod currently supports iron/copper/coal/stone and BoB's ores, but it's pretty easy to add new ones.

I'd be interested by any feedback :)
Screenshot
console commands
Changes
0.2 : now triggers generation of chunks as needed. can take a while if resources are scarce (several minutes), (but it works in the background, it doesn't freeze the game). Supports multiple simultaneous prospections but due to performance requirements, resources are prioritized towards the older prospections
0.1.1 : support for Dytech. also added missing Gems/Oil/Stone/Coal. Tech now costs 100 red/100 green
0.1.0 : initial release, support for Bob's ores
edit : added a screenshot of the GUI
Attachments
prospect-gui.PNG
prospect-gui.PNG (318.88 KiB) Viewed 7625 times
TheSAguy
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

Re: [MOD 0.12.32] Prospect

Post by TheSAguy »

Great idea!
Will work neat with scarce resource settings.
Looking forward to trying it out.
EDIT: what about a possibility to reveal the resource at a cost. Kind of like lifting the fog of war, where the resource is :)
orzelek
Smart Inserter
Smart Inserter
Posts: 3923
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [MOD 0.12.32] Prospect

Post by orzelek »

This looks interesting. And I do need to find rutile now ;)
I'd need to play around to see how it interacts with RSO - but if you are triggering chunks and that triggers normal chunk generation event it should work as intended.
Do I understand correctly that those chunks remain unrevealed?

Also I looked at the code and I would recommend slight change to prototype access that could help with adding support for any mod.
You can use entity prototypes that are contained in the game.entity_prototypes or use game.item_prototypes and game.fluid_prototypes so that you can support crude oil without problems.
Entity prototypes have the benefit of having all the resources in there and you could iterate over those to scan for all resources that are in game - no need to prepare predefined list then.
You can use something like this:

Code: Select all

	for prototypeName, prototype in pairs(game.entity_prototypes) do
		if prototype.type == "resource" then
                -- add code here
		end
	end
For performance reasons I'd recommend to do it once and store results in local table. Accessing prototypes seems to be quite slow.
johnnyBgoode
Inserter
Inserter
Posts: 42
Joined: Thu Mar 24, 2016 7:12 pm
Contact:

Re: [MOD 0.12.32] Prospect

Post by johnnyBgoode »

I dont 100% understand what the mod does... Does it list all ores that are visible in the map? Or does it find specific ores that a player is looking for outside map visibility? or is it like YARM where you just mark an ore deposit?
Finndibaenn
Long Handed Inserter
Long Handed Inserter
Posts: 55
Joined: Fri Feb 21, 2014 8:53 pm
Contact:

Re: [MOD 0.12.32] Prospect

Post by Finndibaenn »

TheSAguy wrote:Great idea!
EDIT: what about a possibility to reveal the resource at a cost. Kind of like lifting the fog of war, where the resource is :)
When the prospection is complete, you get a bearing (N, S, SE, etc) and a distance for any found deposit . (note: the prospection stops when the first deposit is found of the searched type is found ).
Those bearing/distance will refresh every minute , and are relative to the player, so it should be ample information to get to the deposit.
Finndibaenn
Long Handed Inserter
Long Handed Inserter
Posts: 55
Joined: Fri Feb 21, 2014 8:53 pm
Contact:

Re: [MOD 0.12.32] Prospect

Post by Finndibaenn »

orzelek wrote:This looks interesting. And I do need to find rutile now ;)
I'd need to play around to see how it interacts with RSO - but if you are triggering chunks and that triggers normal chunk generation event it should work as intended.
Do I understand correctly that those chunks remain unrevealed?
I think it plays nicely with RSO, it only asks the game to genrate chunks progressively as prospection spreads outward from the origin point. I've tested it with RSO too.
And yes, the mod doesn't "chart" the map for you, you'll have to move to the deposit using the provided bearings to actually reveal it.
Also I looked at the code and I would recommend slight change to prototype access that could help with adding support for any mod.
You can use entity prototypes that are contained in the game.entity_prototypes or use game.item_prototypes and game.fluid_prototypes so that you can support crude oil without problems.
Entity prototypes have the benefit of having all the resources in there and you could iterate over those to scan for all resources that are in game - no need to prepare predefined list then.
Thanks ! i'll take advantage of that.

I'd be interested by any advice regarding how to integrate this into the actual gameplay.
I feel this ability is quite interesting and may justify high costs , and probably even more when spreading outwards ?
Finndibaenn
Long Handed Inserter
Long Handed Inserter
Posts: 55
Joined: Fri Feb 21, 2014 8:53 pm
Contact:

Re: [MOD 0.12.32] Prospect

Post by Finndibaenn »

johnnyBgoode wrote:I dont 100% understand what the mod does... Does it list all ores that are visible in the map? Or does it find specific ores that a player is looking for outside map visibility? or is it like YARM where you just mark an ore deposit?
The mod is currently a "technical preview" : it allows you to create "ore maps" that when used (as if building) will start searching outwards for the associated ore.
It will stop on the first deposit found (however small).
It will indeed be able to find ores outside "map visibility"
orzelek
Smart Inserter
Smart Inserter
Posts: 3923
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [MOD 0.12.32] Prospect

Post by orzelek »

Few comments after long time trying to find rutile (to many biters around the place ;)):
1. Update time needs to be much shorter - with default one you can miss that it updates.
2. Had some issues with updates stopping - is there a timeout or it was something else?
3. Having ability to keep more then one ore deposit per type would be cool - 2-3 maybe.
4. I did increase the search speed - performance impact is very small even with more searches per tick.
Finndibaenn
Long Handed Inserter
Long Handed Inserter
Posts: 55
Joined: Fri Feb 21, 2014 8:53 pm
Contact:

Re: [MOD 0.12.32] Prospect

Post by Finndibaenn »

all comments welcome :)
1/ are you talking about the gui update ? I didn't check what impact it had on performance so i kept it low. (1 per minute). the plugin (ResourceMonitor IIRC, it was 1y ago) I used for an example did a full UI rebuild on every call, so i figured it would be a bit expensive.
2/ I think the version I uploaded shouldn't have requests gone missing. If you have a doubt you can switch on debug mode and check the chunks being requested , if it stays at 0, there's an issue with my mod. If it keeps moving between 0 and a few hundred, the prospection is still running. But the further away it goes, the more chunks it needs to explore before widening again.
3/ The way it currently works doesn't prevent having several deposits of the same type, but you'd have to prospect from a different origin, so that the closest deposit is different than the previous one
4/ IIRC i found (with an empty map, nothing constructed), stuttering while running started around 50 chunks per tick, but your computer may be faster. It was only intended for debugging, but the + and - buttons on the top of the GUI will actually change the chunks prospected per tick

Would you have any suggestion in how to actually bring this into the gameplay ? I don't really like the map idea, and was hoping to be able to have it run similarly to a radar, but I didn't find any API that would allow to do that (eg, trigger on Assembly constrction complete?), did I miss something ?
orzelek
Smart Inserter
Smart Inserter
Posts: 3923
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [MOD 0.12.32] Prospect

Post by orzelek »

Finndibaenn wrote:all comments welcome :)
1/ are you talking about the gui update ? I didn't check what impact it had on performance so i kept it low. (1 per minute). the plugin (ResourceMonitor IIRC, it was 1y ago) I used for an example did a full UI rebuild on every call, so i figured it would be a bit expensive.
2/ I think the version I uploaded shouldn't have requests gone missing. If you have a doubt you can switch on debug mode and check the chunks being requested , if it stays at 0, there's an issue with my mod. If it keeps moving between 0 and a few hundred, the prospection is still running. But the further away it goes, the more chunks it needs to explore before widening again.
3/ The way it currently works doesn't prevent having several deposits of the same type, but you'd have to prospect from a different origin, so that the closest deposit is different than the previous one
4/ IIRC i found (with an empty map, nothing constructed), stuttering while running started around 50 chunks per tick, but your computer may be faster. It was only intended for debugging, but the + and - buttons on the top of the GUI will actually change the chunks prospected per tick

Would you have any suggestion in how to actually bring this into the gameplay ? I don't really like the map idea, and was hoping to be able to have it run similarly to a radar, but I didn't find any API that would allow to do that (eg, trigger on Assembly constrction complete?), did I miss something ?
2. A bit of misunderstanding here - prospection didn't have any issues. Displaying of the result had the problem - might have been very long timer.
3. Ability to find 2 deposits from same origin would be most welcome I think. To have a possible choice which way to go based on other conditions.
4. Check under F5 debug info for timings - for me it doesn't exceed 0.1 ms there with 60 checks per request. Plus/minus buttons did behave strangely for me - either not working at all or only increasing.
Ackos
Long Handed Inserter
Long Handed Inserter
Posts: 92
Joined: Wed May 21, 2014 1:14 pm
Contact:

Re: [MOD 0.12.32] Prospect

Post by Ackos »

Would it be possible to add angels infinite ores?
Finndibaenn
Long Handed Inserter
Long Handed Inserter
Posts: 55
Joined: Fri Feb 21, 2014 8:53 pm
Contact:

Re: [MOD 0.12.32] Prospect

Post by Finndibaenn »

From what I can tell Angels ores are actually Bob's ores, or am I wrong ?
The mod already supports bob's ores
orzelek
Smart Inserter
Smart Inserter
Posts: 3923
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [MOD 0.12.32] Prospect

Post by orzelek »

If you grab angesl infinite ores, processing and bobs you'll get different set of 6 ores. They are separate entities with their own names.
Finndibaenn
Long Handed Inserter
Long Handed Inserter
Posts: 55
Joined: Fri Feb 21, 2014 8:53 pm
Contact:

Re: [MOD 0.12.32] Prospect

Post by Finndibaenn »

Ok ...the only change required seems to be an optional dependency on angelsinfiniteores so that my plugin is loaded after and can create generic maps for angels's ores
TheSAguy
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

Re: [MOD 0.12.32] Prospect

Post by TheSAguy »

I really like the idea of this mod, so I made some icons and updated the recipe slightly.
Instead of copper ore, you use stone ore. Think of it as analyzing the rock to find where the deposits are...

I really would like to add the feature where the map is "revealed" when you first execure the search.
I know the command I normally use is:

Code: Select all

/c game.local_player.force.chart(game.local_player.surface,{lefttop = {x = -1024, y = -1024}, rightbottom = {x = 1024, y = 1024}})
So add that on initial scan. (A lot small area of course)


Anyways. My update attached. :)
Attachments
prospect_0.3.0.zip
prospect_0.3.0
(192.39 KiB) Downloaded 130 times
Post Reply

Return to “Mods”