#Chat Emotes

1 messages ยท Page 1 of 1 (latest)

languid shadow
#

Tower/unit emotes. e.g. "Hey can I have your :barracks:?" or ":tank: is better than :chopper: imo"

fickle plover
#

This should be possible. we would just need to adapt our mention parsing code to parse arbitrary patterns, not just your specific name

raven wave
#

also need to make sure to have img alt be :tower: so you can copy/paste it

fickle plover
random hare
#

All the computation(very small amount) will happen on sender's side

#

and the server will also receive emoji instead of that :: text

#

Code would be pretty simple but if you want complex it with some additional features then I can try that too ๐Ÿ™‚

fickle plover
#

right now the chat messages are transmitted over the network as a string (raw utf8 characters), which is great for censoring and keeps everything simple

this would require something fancy like a collection of both strings, emoji, and mentions

random hare
#

UTF-8 supports emoji or not

#

-_-

fickle plover
#

UTF-8/Unicode supports stuff like ๐Ÿ™‚ but not :barracks:

random hare
#

ah okay

#

for :baracks:

#

we can use svg

fickle plover
#

yes, that's how the rendering would work

random hare
#

the svg tag or img tag with src of that file(Which will be common for all) will be sent

fickle plover
#

sending the entire barracks svg in each chat message mentioning the barracks seems inefficient to me

it's like 1+ kilobytes

random hare
#

So we can implement game emoji + some additional reaction emojis

random hare
#

with aspect ratio

#

Btw Why kiomet is not open source

#

Also I have few questions, is kiomet dependent on Node, like some special API or library. Or it can be written in Deno

#

because game uses Rust and and Rust + Deno are best ๐Ÿ™‚

fickle plover
# random hare We can use img ๐Ÿ™‚
  1. the img.src attribute would have to point somewhere, but we don't host the tower svg images anywhere
  2. allowing html into the chat seems like it could have very big security implications

Btw Why kiomet is not open source

I have hopes of eventually open-sourcing it. Right now, doing so would allow too much exploitation due to how much extra data the server sends and the client simply ignores. Changing the code to not ignore the data would constitute relatively easy visibility cheating.

Also I have few questions, is kiomet dependent on Node, like some special API or library. Or it can be written in Deno

Kiomet is entirely written in Rust + Yew framework. Rust compiles to WebAssembly, and a small JavaScript shim. I don't think it depends on node.

random hare
fickle plover
random hare
#

finally some good change in source code. Node ducks in all things

#

JavaScript itself is pretty ducking bad, thanks to Deno it's getting better. I was going to recommend Fresh Framework by Deno team instead of node

#

Node libraries are bloated, a lot

#

and confusing, they are not standardized properly, I mean you can use cjs, but you can also use es modules

#

which creates lots of conflicts. So basically after long long chats, I wanted to say Node is bad

#

that's it ๐Ÿ™‚

fickle plover
#

I have to say I agree ๐Ÿ˜‚

random hare
#

if you get change try Deno though, it's like Rust but with JavaScript Syntax

fickle plover
#

when I used to write node, I had callback chains about 10 layers deep

random hare
#

now you can use try catch ๐Ÿ™‚

#

it's just 2 blocks to check for errors

fickle plover
#

async/await/Promise is nicer than Rust's async/await/Future support, although at the cost of performance

random hare
#

I have used rust little bit and it's confusing for me

fickle plover
random hare
#

I am always confused vector and stuff, where is array, how to write objects

#

after lots of searching I found out rust don't support classes but struct and impl

#

but I still love rust, doesn't matter I duck at it

#

I want to say few things btw, You guys should keep the code common for mk48 and kiomet UI. I mean the things that are supposed to be common, just keep theme separate.

fickle plover
# random hare I am always confused vector and stuff, where is array, how to write objects

vector

Vec is a dynamically sized collection similar to Javascript's Array in that you can keep calling push to add more items

where is array

you get arrays, which are fixed size collections, using [0u16; 5] syntax (creates an array of 5 u16's each storing 0

how to write objects

with struct and impl

after lots of searching I found out rust don't support classes but struct and impl

rust doesn't really support inheritance of struct

fickle plover
random hare
fickle plover
random hare
fickle plover
# random hare so how do you do OOP

OOP meaning inheritance is a big mistake IMO (see: https://betterprogramming.pub/object-oriented-programming-the-trillion-dollar-disaster-92a4b666c7c7 and other criticisms)

OOP meaning dynamic dispatch, objects storing other objects and calling methods, and encapsulation are all fine principles and fully supported by Rust

you have to change your mindset a bit to express your code in an idiomatic way. once you do, you'll find that Rust can express most patterns with extreme ease, flexibility, and performance

ah I thought you were saying about backend + frontend but you meant both games

well, both!

fickle plover
#

OOP's inheritance looks great in a 50 line example program, but breaks down spectacularly when a database or serialization is involved

random hare
#

Reason - Because I only know two - Function and OOP, I never tried any other

fickle plover
random hare
#

well I do need when, building a CSS parser or any other language parser, creating a game

#

and little more

#

btw I also wanted to ask

#

when is team system coming to kiomet

#

I would love to see allies colored yellow, green, orange

fickle plover
# random hare well I do need when, building a CSS parser or any other language parser, creatin...

when dealing with a CSS parser, you might think you need a Attribute class and a WidthAttribute/BorderAtribute subclass or something. You could instead use ```rust
enum AttributeData {
Width(String),
Border{
left: String,
right: String,
top: String,
bottom: String
}
}

struct Attribute {
data: AttributeData,
some_other_field_1: ...,
some_other_field_2: ...,
}


IMO `enum` is one of the main advantages of expressing code in Rust, because it can replace much of the need for inheritance.
fickle plover
random hare
#

btw we are in Chat emotes

#

#general