Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (767)
Games in Android Showcase (230)
games submitted by our members
Games in WIP (854)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Reactive Games?  (Read 843 times)
0 Members and 1 Guest are viewing this topic.
Offline pavul

Junior Devvie


Medals: 4
Exp: 4 years



« Posted 2018-03-27 17:15:32 »

i have been noted since last year, that today there is a trending topic called React, reactive, most for web development,

how can be react approaches be applied to games, or can we say that GAMES are REACTIVE BY NATURE?

its better not know why it works, that know why is not working
Offline philfrei
« Reply #1 - Posted 2018-03-27 17:31:11 »

I'm thinking this just refers to React, a very popular JavaScript library.

I don't know about specific issues that arise when using this library.

It seems to me that a player "reaction" is a necessary condition for a game.


music and music apps: http://adonax.com
Offline pavul

Junior Devvie


Medals: 4
Exp: 4 years



« Reply #2 - Posted 2018-03-27 18:09:51 »

we have other libraries in java like Java Rx, spring 5 with react components, but i think this is due web development was more stateles, i think a game is reactive in nature, because all sprites for example have a reaction between them.

its better not know why it works, that know why is not working
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline DrZoidberg

JGO Coder


Medals: 21



« Reply #3 - Posted 2018-03-27 21:14:08 »

React is a library for building user interfaces on websites.
The core idea is to "rerender" the entire UI every time something changes instead of modifying only the element that changed.

In games that is usually done anyway. In regular intervals e.g. 60 times per second the entire screen content in a game is rerendered.
Doing the same thing on a websites used to be considered too slow, so programmers avoided it and instead only changed what needed to change.
The problem was that this complicated web design since rerendering everything is simpler and makes the code more modular and easier to maintain.
So React offered a way to solve this by making the rerender approach much faster. It achieves that by pretending to rerender everything while in reality the library determines internally which components actually need to be changed and only changes those. But that process is transparent and the programmer doesn't have to worry about it.

So the difference between a reactive web site and most games is that the game will actually rerender everything for real while the React library only behaves as if it does so.
Now we could ask why browser manufacturers can't simply make the rendering process of graphical elements faster. But that seems to be tricky for some reason.
I found a post on ycombinator about that question. https://news.ycombinator.com/item?id=9155564
Offline nsigma
« Reply #4 - Posted 2018-03-28 10:34:11 »

Note that there are RxJava extensions for Swing and JavaFX.  You don't have to consider this to be about rendering at all - it's a great way to hook events up to actions.  I built a light weight reactive streams / functional reactive like API into Praxis LIVE and love working with it (mine, like the Swing / JavaFX implementations, is single-threaded, while the main RxJava / reactive streams handle concurrency for you too).

Also, the basic building blocks for concurrent reactive programming are now in the JDK - https://docs.oracle.com/javase/9/docs/api/java/util/concurrent/Flow.html

Praxis LIVE - hybrid visual IDE for (live) creative coding
Pages: [1]
  ignore  |  Print  
 
 

 
EgonOlsen (1303 views)
2018-06-10 19:43:48

EgonOlsen (1161 views)
2018-06-10 19:43:44

EgonOlsen (900 views)
2018-06-10 19:43:20

DesertCoockie (1301 views)
2018-05-13 18:23:11

nelsongames (1106 views)
2018-04-24 18:15:36

nelsongames (1338 views)
2018-04-24 18:14:32

ivj94 (2080 views)
2018-03-24 14:47:39

ivj94 (1231 views)
2018-03-24 14:46:31

ivj94 (2214 views)
2018-03-24 14:43:53

Solater (798 views)
2018-03-17 05:04:08
Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45

Deployment and Packaging
by philfrei
2018-08-20 02:33:38

Deployment and Packaging
by philfrei
2018-08-20 02:29:55

Deployment and Packaging
by philfrei
2018-08-19 23:56:20

Deployment and Packaging
by philfrei
2018-08-19 23:54:46
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!