Re: logically weird loop

Liste des GroupesRevenir à cl c  
Sujet : Re: logically weird loop
De : profesor.fir (at) *nospam* gmail.com (fir)
Groupes : comp.lang.c
Date : 21. Nov 2024, 12:01:35
Autres entêtes
Organisation : i2pn2 (i2pn.org)
Message-ID : <96401a3aaf714543b12b08e3cf052b95219fd507@i2pn2.org>
References : 1 2 3 4 5
User-Agent : Mozilla/5.0 (Windows NT 10.0; WOW64; rv:91.0) Gecko/20100101 Firefox/91.0 SeaMonkey/2.53.19
fir pisze:
Janis Papanagnou pisze:
On 21.11.2024 00:53, Lawrence D'Oliveiro wrote:
On Wed, 20 Nov 2024 17:34:34 +0100, Janis Papanagnou wrote:
>
[*] A friend of mine just recently implemented the code frame for a
roguelike and followed the suggestion of an event based object-oriented
implementation; it worked well, he told me.
>
The next step would be to use coroutines so the logic of a longer-running
task, which has to wait for other events at multiple points, can be
written in a single linear stream without having to be fragmented into
multiple callbacks.
>
Yes, indeed.
>
Actually, if you know Simula, coroutines are inherent part of that
language, and they based their yet more advanced process-oriented
model on these. I find it amazing what Simula provided (in 1967!)
to support such things. Object orientation[*], coroutines, etc.,
all fit together, powerful, and in a neat syntactical form. - But
"no one" is using Simula, and my friend was using C++; don't know
what C++ supports in that respect today. I know that he implemented
the "simulation" parts (queuing, time-model, etc.) in C++ himself.
>
Janis
>
[*] It was the language who invented Object Orientation - quite
naturally a concept from the simulation perspective -, but they
neither invented nor used the term "OO"; probably because it was
much more than that what they provided.
>
well i code things myself - no queue just a fileds
 long action, action_start, action_end;
 (where action is pseudoenum describing the action is
doin by bot in a span of action_start to action_end)
 in simply if time raches action_end the action is finalized and new
action is set up.. the arguments to pass i will probably try to be none i mean tch bot fields would store them)
 i will se how it will be going - thsoe are game design decisions and its sometimes hard to really know what is best before really coding this..so
experuiance will show
 though im old and tired and i not quite devoted to coding
anyway..only sometimes i try something to kill some time
  
there is a question qhat would be more logical (prone, suitable) here
for example it is a movement and say takes 200 mikroturns then logicall
would be to not do this as Setup() in turn 0 and finalize(0 in turn 200
but add 1/200 of distance in each turn.. but the rogualike is in discrete space on tiles so i think setup() and finalize() is probably better
more yet in things like fight ..say one character was Setuping() a hit
which takes like 90 microturns to finalize and the defender could be able to setup() a shield blocking or something or decide to setup a
hit too
i dont tested it yet but my [previous approach without the actions that spans in time was much simpler and you only eventually check what last action of given bot waas bot not which next or current is
some would say tehe simpel would suffice but in fact if soeme want model
more nice system you need that spaning action time imo...sadly the division of myriads of this actions on setup() and finalize() is worse to code

Date Sujet#  Auteur
20 Nov 24 * logically weird loop32fir
20 Nov 24 +- Re: logically weird loop1fir
20 Nov 24 `* Re: logically weird loop30Janis Papanagnou
20 Nov 24  +* Re: logically weird loop4fir
20 Nov 24  i`* Re: logically weird loop3fir
20 Nov 24  i `* Re: logically weird loop2fir
21 Nov 24  i  `- Re: logically weird loop1fir
21 Nov 24  `* Re: logically weird loop25Lawrence D'Oliveiro
21 Nov 24   +* Re: logically weird loop21Janis Papanagnou
21 Nov 24   i+* Re: logically weird loop6fir
21 Nov 24   ii`* Re: logically weird loop5fir
21 Nov 24   ii `* Re: logically weird loop4Janis Papanagnou
21 Nov 24   ii  `* Re: logically weird loop3fir
21 Nov 24   ii   `* Re: logically weird loop2Janis Papanagnou
22 Nov 24   ii    `- Re: logically weird loop1fir
22 Nov 24   i+* Re: logically weird loop9Lawrence D'Oliveiro
22 Nov 24   ii+- Re: logically weird loop1Janis Papanagnou
22 Nov 24   ii`* Re: logically weird loop7Michael S
22 Nov 24   ii +* Re: logically weird loop2fir
22 Nov 24   ii i`- Re: logically weird loop1fir
5 Dec 24   ii `* Re: logically weird loop4Tim Rentsch
5 Dec 24   ii  `* Re: logically weird loop3Janis Papanagnou
5 Dec 24   ii   `* Re: logically weird loop2David Brown
5 Dec 24   ii    `- Re: logically weird loop1Janis Papanagnou
5 Dec 24   i`* Re: logically weird loop5Tim Rentsch
5 Dec 24   i `* Re: logically weird loop4Janis Papanagnou
7 Dec 24   i  `* Re: logically weird loop3Tim Rentsch
7 Dec 24   i   `* Re: logically weird loop2Keith Thompson
8 Dec 24   i    `- Re: logically weird loop1Kaz Kylheku
22 Nov 24   `* Re: logically weird loop3fir
22 Nov 24    `* Re: logically weird loop2fir
24 Nov 24     `- Re: logically weird loop1fir

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal