9front - general discussion about 9front
 help / color / mirror / Atom feed
From: rgl@antares-labs.eu
To: 9front@9front.org
Subject: Re: [9front] new game: battleship (aka sink the fleet)
Date: Tue, 05 Sep 2023 12:34:49 +0200	[thread overview]
Message-ID: <756A1865A032E8EDC1FD2B1FD17A4E7D@antares-labs.eu> (raw)
In-Reply-To: <E01D40F9AD87688688A6D00ECADA04C4@wopr.sciops.net>

hi qwx!

> How do you feel about adding this to /sys/src/games?  Me and others
> would love to see this added, we lack online multiplayer games.

i appreciate your interest, and i'd love that, but it definitely needs
some polishing before we push it.  :)

> The *.man files seem to be missing from the repo, so the `all' target
fails.

yeah, i started writing a manual for both client and server.  that
will be done soon!

> You should also account for mouse movement while a key is
> held; using a trackpoint, if trying to rotate a ship at the start with
> mmb, it will keep flipping until your finger is perfectly still, etc.

indeed, it sucks.  it was previously implemented using menuhit(2), so
that didn't happen, but then based on some feedback i decided to get
rid of it and forgot to take care of the resulting misbehavior.  i'll
fix it.

> There's some other small things that aren't bugs that could be
> discussed.

there's actually a bug that i want to investigate before i continue
adding stuff.  i found it while adding the user tags, and it's not
pretty; it has to do with some stack overflow and libthread, and i
don't understand it.  increasing the mainstacksize doesn't solve it,
so it seems like a deeper issue.  you can reproduce it by removing the
static attribute from threadmain:user, after which you won't be able
to place the fleet because the Mousectl.xy coordinates go through the
roof (you can see this in real-time by placing a print(2) in /^mouse\(
).

leak(1) points to the getenv("user") that first sets the variable, and
moody also told me to add a watchpoint to &mc->xy, and catch who's
writing on that memory.  i'll dive into this when i have more free
time, probably next weekend.

> Do you plan on adding more stuff?  I'd personally love to see AI
> opponents and games with more than 2 players (your code doesn't
> entirely assume only two), replays/demos, perhaps spectators, etc. :)

one of the things people suggested on the grid was being able to join
as an spectator, and i think that should be easy to implement reusing
the playerq queue, adding a flag to the players and popping only those
who are there to FIGHT.  that way there's no need to change the reaper
nor the matchmaker procs.  i could also add another queue so the
popping remains O(1) and not potentially O(n), but we'll see.

by the code not being restricted to two players, i guess you are right
on the battle proc, since you could add as many players as you want
with a little adaptation.  still, there's only two sides in a battle,
so we'd have to tag the players, add a turn queue and then perform the
actions based on which side they are in.  we also have to think about
how one would join such a game, there're people who will prefer a 1v1,
and others who will want their own group battle.  this sounds like it
would be fun though.  haha

as for the AI, it didn't even cross my mind, but i'd be open to
suggestions/patches.  :)


cheers!

-rodri


  reply	other threads:[~2023-09-05 10:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-02 15:19 rgl
2023-09-05  0:17 ` qwx
2023-09-05 10:34   ` rgl [this message]
2023-09-06  1:45     ` Amavect
2023-09-06  1:47       ` Stanley Lieber
2023-09-06 10:47         ` rgl
2023-09-06 11:37           ` sirjofri
2023-09-06 12:31             ` Sigrid Solveig Haflínudóttir
2023-09-06 10:38       ` rgl
2023-09-07  2:43         ` Amavect
2023-09-07  6:55           ` rgl
2023-09-10 11:56             ` rgl
2023-09-12  3:09               ` Amavect

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=756A1865A032E8EDC1FD2B1FD17A4E7D@antares-labs.eu \
    --to=rgl@antares-labs.eu \
    --cc=9front@9front.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).