D for Game Development

Rikki Cattermole via Digitalmars-d digitalmars-d at puremagic.com
Sun Aug 2 20:28:22 PDT 2015


On 3/08/2015 1:35 p.m., Sebastiaan Koppe wrote:
> On Sunday, 2 August 2015 at 14:03:50 UTC, Rikki Cattermole wrote:
>> Some of things that goes on in the modding world is truely amazing.
>>
>> For every item/block with a recipe and vanilla items/blocks hardcoded.
>> It'll calculate at the start of runtime an EMC value in EE3. It does
>> it ridiculously fast.
>
> I understand absolutely nothing about it.

I'll try my best to explain it.

- An item/block may or may not have a crafting recipe, it may have many 
or uses a non crafting mechanism to create
- There could be 200k-400k+ blocks and items per modded instance
- Each item/block may have an "EMC" value which is 1 .. int.max
- The EMC value is calculated based upon the crafting recipes and all 
items/blocks that makes it up EMC values
- Vanilla blocks/items have hard coded EMC values
- Optionally other mods items/blocks may be required to have their 
values hard coded so the calculation can work
- Back in EE2 it was all hard coded
- In EE3 very few are hard coded

The usage of the EMC value doesn't really matter. What does matter is 
that these calculations occur at the start of runtime. If this was 
poorly written this would have massive performance problems.


More information about the Digitalmars-d mailing list