Deutsch   English   Français   Italiano  
<aa432fe774f2f9e28fb28d6a4778ffb2d93b8f28@i2pn2.org>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!weretis.net!feeder9.news.weretis.net!news.nk.ca!rocksolid2!i2pn2.org!.POSTED!not-for-mail
From: fir <profesor.fir@gmail.com>
Newsgroups: comp.lang.c
Subject: Re: logically weird loop
Date: Thu, 21 Nov 2024 14:05:58 +0100
Organization: i2pn2 (i2pn.org)
Message-ID: <aa432fe774f2f9e28fb28d6a4778ffb2d93b8f28@i2pn2.org>
References: <0e1c6d2e74d44a715bf7625ca2df022d169f878a@i2pn2.org>
 <vhl32r$66a2$1@dont-email.me> <vhlspv$ahc9$10@dont-email.me>
 <vhmilk$hd28$1@dont-email.me>
 <b54060bee6b2e1997c7f1047c63b975a9d4ca108@i2pn2.org>
 <96401a3aaf714543b12b08e3cf052b95219fd507@i2pn2.org>
 <vhn8ta$kts8$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 21 Nov 2024 13:06:02 -0000 (UTC)
Injection-Info: i2pn2.org;
	logging-data="3491254"; mail-complaints-to="usenet@i2pn2.org";
	posting-account="+ydHcGjgSeBt3Wz3WTfKefUptpAWaXduqfw5xdfsuS0";
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:91.0) Gecko/20100101
 Firefox/91.0 SeaMonkey/2.53.19
X-Spam-Checker-Version: SpamAssassin 4.0.0
In-Reply-To: <vhn8ta$kts8$1@dont-email.me>
Bytes: 5029
Lines: 83

Janis Papanagnou pisze:
> On 21.11.2024 12:01, fir wrote:
>>
>> 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
> 
> My opinion on that...
> 
> For a roguelike, don't model it too detailed or too "realistic"; it
> happens too often that you're getting lost in unnecessary complexity.
> 
> Keep it time-discrete (as you indicated above), define an integer of
> sufficient length, don't use numeric types with fractions, define a
> sensible base unit (that conforms probably to your 1/200 unit).
> 
> The start of action is the primary point in time. With "elementary"
> actions (place a hit, quaff, read, loot, etc.) it's not worth to
> complicate things; just consider the actual environmental situation
> of the dungeon installations or individuals that affect your action
> in any way.
> 
> It is an issue when _long lasting actions_ (like learning spells,
> eating, etc.) will get "interrupted". Here I suggest to inspect the
> Nethack code (obviously being still the "standard" roguelike), or
> have a look into GnollHack (which IMO may have a more sophisticated
> way to handle such interrupts). - I've not looked into the code so
> I cannot give you concrete information; it's just from observation.
> 
> Practically I'd have, for example, an eating character put into a
> queue at the time when its eating is supposed to get finished. In
> case another actor or event pops in to affect the player (or the
> [user-perceivable] environment) the player object will be taken
> from the queue, its status (e.g. unfinished food consumption)
> updated, and rescheduled. The actual activation-time for that may
> be immediately (after) the triggering event source, or delayed
> (e.g. after gotten hit by sleep or paralysis) to the time it is
> required for the effect to wear off.
> 
> I think such event-queues on a time-scale makes things more easier
> and more consistent to implement.
> 
> (I also think that using C for such a task is not the best choice.
> C++ at least provides classes to keep things together. - But that
> just aside, to not angering the audience too much.)
> 
> Janis
> 
> REACTIVATE this.player DELAY meal_time (food_item.nutrition)
> 

well im somewhat experienced in writing roguelike (never make some 
finished but i wrote them i dont know in sum maybe about 3-4 months day 
bay dey

previously i used thsi simpler approach and the conclusion from 
experiecne was i need something that stores the action..

bothering bots i dont see as a problem but it is just needed to eb able 
to bother them - not for being unable for bother them... i just need a 
lot of cases when i could combine warious states for good efects

spells in turn if casted just live on their own loop so they not block
a caster if are casted