Anonymous Login
2017-11-21 15:01 CET

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0001148OpenClonkObjectspublic2017-11-11 10:54
Reportertimi 
Assigned ToClonkonaut 
PrioritynormalSeveritytweakReproducibilityalways
StatusresolvedResolutionfixed 
Product Version5.1 
Target Version8.0Fixed in Versiongit master 
Summary0001148: Loam from sand
DescriptionIn my opinion it's rather fussy and annoying that loam apparently can't be made of sand.
TagsNo tags attached.
Attached Files

-Relationships
+Relationships

-Notes

~0003149

Maikel (developer)

Indeed, sand could also be used to produce loam. However implementing this option in the producer library presents us with some non-trivial design decisions.

A solution would be to allow different materials, like sand and earth and let the loam give back this:

public func GetMaterialNeed() { return ["Earth", "Sand", 25]; }

And adapt the producer library accordingly, to also for example accept 10 sand and 15 earth.

However, personally I'd rather see a solution without the bucket.

~0003155

Pyrit (developer)

Maybe the bucket could be a passive item. It gets filled when you have it in your inventory and dig around with the shovel...

Or have a (dry) clay material that can be mined like everything else...

~0003986

Zapper (developer)

The bucket now indeed DOES simply collect earth objects. So maybe this can be fixed easier now?

~0003987

Sven2 (developer)

Last edited: 2015-10-23 21:16

View 2 revisions

Generally, a cool option would be if required components could be given as properties or callback functions instead of IDs. So you could write stuff like func GetComponents() { return [["IsEarth", 1], [Water, 1]]; }

It would either require to move the component logic to script or add that as an engine feature, both of which might be a bit of work.

~0003990

Zapper (developer)

The producer logic is completely in script already. We currently allow producing stuff from e.g. water + [id] already, even though water is not a definition.

So, implementing alternatives wouldn't really be too much effort I guess?

~0003991

Sven2 (developer)

Moving GetComponents to script also means the engine has to use that for things like SplitComponents. Also, which message to you display when IsEarth is needed?

An alternative would be to have a callback on definitions if they can be used as a replacement for other definitions. So Sand would have

func IsAlternateComponent(id product, id component) { return component == Earth; }

That would be simpler to implement and we'd still have the primary definition for a component for things like SplitComponent, required material messages, etc. If something is really a "generic" requirement (such as "any liquid"), we can make an "any liquid" definition with proper name, symbol, etc.

~0003997

Clonkonaut (developer)

(Split2Components is already in script, System.ocg/Object.c)

~0004000

Zapper (developer)

Last edited: 2015-10-24 19:37

View 2 revisions

Why wouldn't sand just have GetAlternativeComponents() { return [Earth]; }?
Do I misunderstand how you want to use that callback?

PS: and the ideal solution would somehow streamline material requirements (water / acid) and alternative object requirements.

~0004003

Sven2 (developer)

Last edited: 2015-10-24 20:22

View 2 revisions

Passing the product and the component would allow very generic materials like "allow as replacement for every component that weighs less than X" or "allow as replacement to build any vehicle". I don't know if that's a scenario we want.

It's also easier to use because you can do FindObject(Find_Or(Find_ID(wanted_component), Find_Func("IsAlternateComponent", product, wanted_component))) to look for components. With your suggestion, you need to do array cross-checks for every potential component object.

Your suggestions sounds better if it were reversed (GetAlternativeComponents() { return [Sand]; } in the script of the earth object). That would be easier to use for the producer library. It just has to ask each component for alternatives and search for them, but it wouldn't allow third party packs to insert themselves as alternative objects without modifying the script of the base object.

The scenario I have in mind is the Clonk Rage Western pack. There we had alternate fur and bone objects from all kinds of animals which had to be used as alternate components. I think the solution was to ChangeDef to the main object and do SetGraphics for the custom appearance (which is a hack that has problems).

~0004004

Zapper (developer)

Ah, okay. I misunderstood you, I thought the function was supposed to be in the definition that is to be replaced (like you described).

Do you have any idea how alternative components could be communicated to the player with your proposal?

For example, the loam should ideally show all allowed components in the "material requirements" section in the production menu. If the loam (and earth) do not even KNOW all possible components, this will be a bit harder.

~0004006

Sven2 (developer)

I can't think of a solution that isn't unnecessarily confusing. So for the sake of simplicity, I wouldn't show it at all.

Resolution of alternate IDs from the main ID (in this case: Earth) is a problem. But if the producer needs it, it could be done in the Definition() callback of the producer library by iterating over all loaded definitions. Anyway, if we don't show the alternate IDs we also don't need to resolve them.

~0004008

Zapper (developer)

I really would like to show them, though. Stuff like that is what can make the game frustrating to play.

The scenarios should be hard, because they challenge the player in some way. But not because you have to figure out first that you can build loam from sand, too.

And especially when the foundry insists that "YOU ARE MISSING EARTH!!!" it's not really intuitive that you just try out whether sand works, too. Aaand we don't have a comprehensive wiki like Terraria where you can look up everything.

~0004009

Sven2 (developer)

> Stuff like that is what can make the game frustrating to play.

Only if a scenario has sand but not earth. Not understanding the component message has a lot more potential to be frustrating.

Maybe it can go into the description field or into a large box when there's enough space for words (Components: Earth {{Earth}} (or Sand {{Sand}}) and Water {{Water}}}).

~0004010

Zapper (developer)

>Only if a scenario has sand but not earth.

Which isn't too unrealistic :)

The required materials are currently displayed in the description box. So, yeah, that's where it would go!

~0004573

Armin (reporter)

I haven't read the discussion but just an idea:
We could create a sand loam object. That would be easy and has also the advantage that you can build sand walls with it. I know that item wouldn't be used so often but I don't see a problem with that, its more variety.

~0004574

Maikel (developer)

I am against having two similar objects with the same functionality.

~0005857

Clonkonaut (developer)

Reminder sent to: Maikel, Zapper

I uploaded a possible way to display substitions in the production menu. Any thoughts?

~0005858

Clonkonaut (developer)

Last edited: 2017-10-26 17:18

View 2 revisions

This is the interface, simple but enough for our usecases:

public func GetSubstituteComponent(id component) // Can be made from earth or sand
{
    if (component == Earth)
        return Sand;
}

You can also return an array, so the teleglove could be made from rubies, amethysts or diamonds. And yes, I know this could make the list kind of long. One just has to be careful what the production costs for an item will be. Even know you can easily make a very long list and make it look ugly.

~0005859

Clonkonaut (developer)

alternative.jpg is more compact version, but less easier to read.

~0005866

Clonkonaut (developer)

Actually, this wasn't too hard to do.

~0005867

occ (reporter)

Hi! There's been a check-in that references this bug. For more information you can visit the repository browser at this address:
https://git.openclonk.org/openclonk.git/commitdiff/fceda32505bb5cb206af9f89b76c3b4ad231d9c7

Changeset fceda32 by Clonkonaut <Armag3ddon@web.de>
Loam production: substitute sand for earth (0001148).

~0005869

Clonkonaut (developer)

I took the liberty of pushing this. Removing the feature will be dead easy (remove that one function from loam, edit the description).

~0005901

Maikel (developer)

I am happy with this change, checked that it works and see no reason to keep the bug report open.
+Notes

-Issue History
Date Modified Username Field Change
2014-10-13 20:49 timi New Issue
2014-10-18 11:36 Maikel Note Added: 0003149
2014-10-18 11:36 Maikel Status new => acknowledged
2014-10-18 11:49 Maikel Target Version => 6.1
2014-10-18 17:08 Pyrit Note Added: 0003155
2015-10-16 02:33 Sven2 Target Version 6.1 => 7.0
2015-10-23 18:58 Zapper Note Added: 0003986
2015-10-23 21:15 Sven2 Note Added: 0003987
2015-10-23 21:16 Sven2 Note Edited: 0003987 View Revisions
2015-10-23 21:31 Zapper Note Added: 0003990
2015-10-23 21:36 Sven2 Note Added: 0003991
2015-10-24 12:52 Clonkonaut Note Added: 0003997
2015-10-24 19:36 Zapper Note Added: 0004000
2015-10-24 19:37 Zapper Note Edited: 0004000 View Revisions
2015-10-24 20:20 Sven2 Note Added: 0004003
2015-10-24 20:22 Sven2 Note Edited: 0004003 View Revisions
2015-10-25 00:00 Zapper Note Added: 0004004
2015-10-25 01:16 Sven2 Note Added: 0004006
2015-10-25 08:06 Zapper Note Added: 0004008
2015-10-25 15:38 Sven2 Note Added: 0004009
2015-10-25 16:05 Zapper Note Added: 0004010
2015-11-30 14:29 Clonkonaut Target Version 7.0 => 8.0
2016-01-13 08:16 Armin Note Added: 0004573
2016-01-13 08:51 Maikel Note Added: 0004574
2017-10-26 17:12 Clonkonaut File Added: earthorsand.jpg
2017-10-26 17:12 Clonkonaut Note Added: 0005857
2017-10-26 17:16 Clonkonaut Note Added: 0005858
2017-10-26 17:18 Clonkonaut Note Edited: 0005858 View Revisions
2017-10-26 17:32 Clonkonaut File Added: alternative.jpg
2017-10-26 17:33 Clonkonaut Note Added: 0005859
2017-10-27 01:45 Clonkonaut File Added: teleglove.jpg
2017-10-27 01:46 Clonkonaut Note Added: 0005866
2017-10-27 13:26 occ Note Added: 0005867
2017-10-27 13:27 Clonkonaut Note Added: 0005869
2017-11-01 01:39 Clonkonaut Assigned To => Clonkonaut
2017-11-01 01:39 Clonkonaut Status acknowledged => feedback
2017-11-11 09:36 Maikel Status feedback => resolved
2017-11-11 09:36 Maikel Resolution open => fixed
2017-11-11 09:36 Maikel Fixed in Version => git master
2017-11-11 09:36 Maikel Note Added: 0005901
+Issue History