Web UI rather than ImGUI + sfml ? #32

Open
opened 2022-07-12 23:51:34 +02:00 by Sceptique · 4 comments
Owner

Native UI implementation is a pain in the ass until now.
It is very primitive but theoricaly can be very efficient memory wise.

So it might NOT be appropriated to this game.

Unless I try something advanced for fights or on the maps there is very little chances I ever need an advanced UI control.

So basic HTML/CSS/Websocket communication is probably more than enough.

    • It will help having a clear "protocol" to communicate between UI and the systems and data.
    • It will make hyper-simple multi-player game
    • Simple templating and scripting of the UI (since JS and HTML are no brainers)
Native UI implementation is a pain in the ass until now. It is very primitive but theoricaly can be very efficient memory wise. So it might NOT be appropriated to this game. Unless I try something advanced for fights or on the maps there is very little chances I ever need an advanced UI control. So basic HTML/CSS/Websocket communication is probably more than enough. * + It will help having a clear "protocol" to communicate between UI and the systems and data. * + It will make hyper-simple multi-player game * + Simple templating and scripting of the UI (since JS and HTML are no brainers)
Sceptique added this to the v0.3: Planetary and empire policies milestone 2022-07-12 23:51:34 +02:00
Sceptique added the
think
UI
labels 2022-07-12 23:51:34 +02:00
Sceptique added this to the v0.2 project 2022-07-24 22:58:50 +02:00
Sceptique modified the milestone from v0.3: Planetary and empire policies to v0.2: Get population nicer 2022-07-24 22:58:54 +02:00
Author
Owner

I'm starting to use graphql:

Pro:

  • UI centric data
  • Crystal support seems good
  • Not complex to query
  • Require contracts and establish protocol

Con:

  • More complex to setup than raw json without protocol
  • Modern JS is a nightmare
  • Not sure about performances if need to show up lots of data
I'm starting to use graphql: Pro: * UI centric data * Crystal support seems good * Not complex to query * Require contracts and establish protocol Con: * More complex to setup than raw json without protocol * Modern JS is a nightmare * Not sure about performances if need to show up lots of data
Author
Owner

For now the design I've in mind:

  • Kemal will receive the graphql requests
  • Graphql objects#methods should add a message un a queue (Qi)
  • (Qi) is read in a RequestHandlerSystem, which interact with the components and entities. it sends back the data requested in (Qo)
  • Qo is read async by Graphql (HOW ?)
For now the design I've in mind: * Kemal will receive the graphql requests * Graphql objects#methods should add a message un a queue (Qi) * (Qi) is read in a RequestHandlerSystem, which interact with the components and entities. it sends back the data requested in (Qo) * Qo is read async by Graphql (**HOW ?**)
Author
Owner

async is probably easy with Channels

like

class Star
  def name
    channel.send "need star name #{id}"
    Fiber.yield
    channel.receive
  end
end

But I need to finish a POC to make sure it works as I imagine

async is probably easy with Channels like ``` class Star def name channel.send "need star name #{id}" Fiber.yield channel.receive end end ``` But I need to finish a POC to make sure it works as I imagine
Author
Owner

Give up on the POC for now, too much boring work and difficulties to design a "Observer"

Give up on the POC for now, too much boring work and difficulties to design a "Observer"
Sceptique removed this from the v0.2 project 2023-03-05 11:11:24 +01:00
Sceptique removed this from the v0.2: Get population nicer milestone 2023-03-05 11:11:26 +01:00
Sign in to join this conversation.
No Label
IA
UI
bug
economy
think
war
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Reference: TETU/Core#32
No description provided.