From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 30510 invoked from network); 5 Sep 2023 10:44:32 -0000 Received: from 9front.inri.net (168.235.81.73) by inbox.vuxu.org with ESMTPUTF8; 5 Sep 2023 10:44:32 -0000 Received: from relay6-d.mail.gandi.net ([217.70.183.198]) by 9front; Tue Sep 5 06:34:53 -0400 2023 Received: by mail.gandi.net (Postfix) with ESMTPSA id 404E8C0003 for <9front@9front.org>; Tue, 5 Sep 2023 10:34:50 +0000 (UTC) Message-ID: <756A1865A032E8EDC1FD2B1FD17A4E7D@antares-labs.eu> Date: Tue, 05 Sep 2023 12:34:49 +0200 From: rgl@antares-labs.eu To: 9front@9front.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-GND-Sasl: rgl@antares-labs.eu List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: ISO-certified object-oriented method descriptor-aware interface hypervisor-based database Subject: Re: [9front] new game: battleship (aka sink the fleet) Reply-To: 9front@9front.org Precedence: bulk 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