by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • May 24 20:13

    Leopotam on develop

    * README: Released games list u… (compare)

  • May 23 17:05
    Leopotam labeled #33
  • May 23 17:05
    Leopotam closed #33
  • May 23 16:39
    h3xb0y commented #33
  • May 23 13:46
    Leopotam labeled #33
  • May 23 13:43
    Leopotam commented #33
  • May 22 22:18
    h3xb0y opened #33
  • May 22 08:45

    Leopotam on master

    Merge tag '2020.4.22' into deve… * EcsSystems: Nested EcsSystems… * GitIgnore updated. and 9 more (compare)

  • May 22 08:45

    Leopotam on 2020.5.22

    (compare)

  • May 22 08:45

    Leopotam on develop

    * UnityPackage version bump. Merge branch 'release/2020.5.22' Merge tag '2020.5.22' into deve… (compare)

  • May 22 08:42

    Leopotam on develop

    * README: Typo fixes. (compare)

  • May 10 18:07

    Leopotam on develop

    * EcsEntity: Replace() method r… (compare)

  • May 10 10:38

    Leopotam on develop

    * EcsFilter: Possible optimizat… (compare)

  • May 10 10:26

    Leopotam on gh-pages

    * EcsFilterGenTool: Possible op… (compare)

  • May 02 23:40

    Leopotam on develop

    * README: FAQ fixes. (compare)

  • May 01 10:28

    Leopotam on develop

    * EcsEntity: Replace() method a… (compare)

  • Apr 30 22:02

    Leopotam on develop

    * EcsEntity: Set() renamed to G… * EcsFilter: Comments fixed. (compare)

  • Apr 30 22:01

    Leopotam on gh-pages

    * EcsFilterGenTool: Comments fi… (compare)

  • Apr 28 20:03

    Leopotam on develop

    * GitIgnore updated. (compare)

  • Apr 26 10:44

    Leopotam on develop

    * EcsSystems: Nested EcsSystems… (compare)

Leopotam
@Leopotam
what you think about rust as main lang?
RUSshy
@RUSshy
yeah gc is annoying but with pooling and stack alloc / span / unsafe it is manageable
i got TCP server/client without allocations thanks to Span
i don't like rust syntax
maybe in the future i will try again
Leopotam
@Leopotam
pure tcp or websocket?
RUSshy
@RUSshy
TCP i exchange binary data
Leopotam
@Leopotam
websocket is binary too, text data is just one of supported types

unsafe

no way :)

RUSshy
@RUSshy
    public ref struct PReader
    {
        public int position;
        public Span<byte> buffer;

        public byte readByte()
        {
            var data = buffer[position++];
            return data;
        }

        public bool readBool()
        {
            return readByte() == 1;
        }

        public short readShort()
        {
            var ret = BinaryPrimitives.ReadInt16BigEndian(buffer[position .. (position + 2)]);
            position += 2;
            return ret;
        }
        public ushort readUShort()
        {
            var ret = BinaryPrimitives.ReadUInt16BigEndian(buffer[position .. (position + 2)]);
            position += 2;
            return ret;
        }

        public int readInt()
        {
            var ret = BinaryPrimitives.ReadInt32BigEndian(buffer[position .. (position + 4)]);
            position += 4;
            return ret;
        }
        public uint readUInt()
        {
            var ret = BinaryPrimitives.ReadUInt32BigEndian(buffer[position .. (position + 4)]);
            position += 4;
            return ret;
        }

        public float readFloat()
        {
            var ret = BitConverter.Int32BitsToSingle(BinaryPrimitives.ReadInt32BigEndian(buffer[position .. (position + 4)]));
            position += 4;
            return ret;
        }

        public string readString()
        {
            var l = readShort();
            var data = buffer[position .. (position + l)];
            position += l;
            return Encoding.UTF8.GetString(data);
        }
        public string readUTF32()
        {
            var l = readInt();
            var data = buffer[position .. (position + l)];
            position += l;
            return Encoding.UTF8.GetString(data);
        }
    }
Leopotam
@Leopotam
otherwise i can use unity NativeArray and forget about other environments
RUSshy
@RUSshy
example of my allocation free binary reader
RUSshy
@RUSshy
you only use C#?
Leopotam
@Leopotam
in unity - yes. on server - node + ts
and i still in search for not so boring system lang for tools and maybe server side code
golang is bad as for me
rust much better
RUSshy
@RUSshy
there is Swift that is coming to windows
also windows is working on high level system language
maybe answser to rust/swift
Leopotam
@Leopotam
language from ms? no. way. anymore
typescript looks good, but its just syntax sugar over javascript
i dont want to get vendor lock for one platform as ms did before
go-lang or rust-lang looks not so bad as for me
Leopotam
@Leopotam
thread-safe multi-worlds feature merged to develop.
Leopotam
@Leopotam
what if IEcsAutoReset will be renamed to IEcsAutoInit for calling on request for new component from pool? it will work in same way as now (before recycle component to pool) + will be called for new instances
RUSshy
@RUSshy
i have my own pooling system, i named the interface IPoolable, simple and easy to understand
IPoolable.reset()
Leopotam
@Leopotam
repo updated with calling IEcsAutoReset.Reset() for brand new instance (not passed through pool yet) of component.
RUSshy
@RUSshy
@Leopotam few weeks ago you said that class FilterA : EcsFilter<CPosition>{} class FilterB : EcsFilter<CPosition>{} are not the same thing, why?
or i misunderstood what you meant
Leopotam
@Leopotam
yes, because for C# its different types
2 filters instead one
but i think you cant use both of them in same time - both of them required same component
RUSshy
@RUSshy
i don't reuse them, it is a workaround for using CoreRT
because of how generics are discovered, it doesn't work, dunno exactly why
so i create these classes
single use
Leopotam
@Leopotam
maybe its just removed as dead code that not instantiated?
unity il2cpp doing "remove not used classes" in same way - i marked all problem classes with special attributes to fix this issue
Leopotam
@Leopotam
ecs repo updated: EcsFilter autogenerated with custom tool. if you need more than 4 include and 2 exclude components - you can use this tool too (link was added to README): https://leopotam.github.io/ecs/filter-gen.html
Leopotam
@Leopotam
@RUSshy ecs repo updated: EcsWorldConfig switched from class to struct. on any <= 0 values default values will be used instead.
RUSshy
@RUSshy
:D
Justin van der Leij
@Tjakka5

Hello!
I stumbled upon this project just now, and I'm playing around with it a bit.

I'm looking to make a hierarchy system, and I'm wondering how I should store references to entities.
Should I be using the actual ECSEntity, or only it's ID?

I'm guessing ECSEntity so I can do ìf (entity == ECSEntity.Null) but I'd like to make sure :sweat_smile:
Leopotam
@Leopotam
@Tjakka5 ecs is not about hierarchy, but about plain data, you can process it in any way
yes, you can store EcsEntity as field of component

Should I be using the actual ECSEntity

yes, you should use actual EcsEntity data to store. before use you should check - is this entity still alive or not with EcsEntity.IsAlive() call

btw, if you want to get answers faster - better to use discord: https://discord.gg/5GZVde6