You are browsing as a guest. Sign up (or log in) to start making projects!

ValoGuess

  • 4 Devlogs
  • 32 Total hours

I'm building a game where you have to guess the Valorant Agent via asking questions from a preset panel or your own custom question via chat to the opponent player. It's a 1v1 game. You have guess the agent before your "no" runs out . "NO" means the questions you ask will result in either "Yes" Or "No" via the other player.

Open comments for this post

9h 18m 20s logged

Devlog 4

  • So first of all I switched from using npm to pnpm and updated the docker file accordingly for the socket server.

  • Then I started working on adding users / db functionality in the nextjs app.

  • I created login and register page with two options for signIn -> google or guest.

  • I started tinkering with prisma and better auth and the prisma8 has just come so I started setting it up and had made the schema and had written up some services too but then when I tried to logIn i got few problems which I researched and searched and found out that betterAuth hasn’t adjusted to prism8.

  • So I did what I should have done before, I switched to drizzle. Around 3-4 or more hours were wasted!.
    Now I’m using drizzle and have setup the schema and tables and also better auth in it and the signIn are working.

  • Now I have to create routes or server Actions to retrieve data or send data. Now the games will be saved and stored once finished and user will able to see it in match history.

0
0
9
Open comments for this post

5h 33m 3s logged

Devlog 3

Backend Socket Server

  • Made few changes to setting type and added a questionPool in gameState
  • Settings now have a option to change totalQuestions and a randomly generated questionPool from the totalQuestions
  • Removed spectator logic as not planning on pursuing it right now
  • Also added a heartbeat event which supplies heartBeat every 5 seconds or so and if there is no heartBeat provided by the player for over 30 seconds the player gets removed from the room

Now Frontend

  • Redesigned the lobby page and home page
  • If you open the game for the first time it asks for the name which is currently stored in localstorage for a guest user.
  • When users are added then people would be able to login using google and save their details in database.
  • For now nothing is stored , only gameState are persistent for the duration of the game in redis and after few minutes of inactivity in the room , the room expires via ttl.
  • Also added SEO Optimisations.

Future Plan

  • I will either work on adding more gamemodes or adding the user authentication stuff using postgresql and prims direclty in nextjs
  • After the auth has been added then I will publish the project so that it has atleast some complete features and users can see their stats and prev games results
0
0
3
Open comments for this post

8h 31m 33s logged

Devlog 2

Making this devlog after a long time of doing all this work, the frontend part is still uncommited in github though

Lets talk about backend first ->

  • I first of all was using playerId for the routes to verify the user, but now I’m using socketId
  • And also for reconnection I’m now using a reconnectToken which is created on the socket server and given to the frontend to it can pass it when reconnecting.
  • Also I added a ROOM_KICK event.
  • And I added docker setup too but its still buggy
  • Changed Winning logic so that first correct guess wins

Now Frontend

  • I designed the pages using AI because I am not a good designer rather I am a good coder you can say, because if there is a already made design, I can make a similar one using tailwind and shadcn and other UI libraries
  • I added socket setup for the frontend which goes as follow
  • src/socket -> index.ts, emitter.ts, events.ts
  • src/components/SocketProvider.tsx
  • Socket Provider has the listeners
  • emitter.ts has small functions that can be directly used inside tsx instead of importing socket
  • There are 3 pages currently -> /, /lobby, /play
0
0
9
Open comments for this post

8h 38m 25s logged

Devlog 1

So I’ve been working on the socket server for this game for the past couple of days. What I’ve learned so far is that game logic is sometimes so frustrating like there can be so many edge cases you have to think about and there can be many nested if else.

So my tech stack for the socket server is:

  • Socket.io
  • IoRedis (redis hosted using docker)
  • Zod
  • and node httpServer

Ofcourse everything is written in typescript. I didn’t made separate devlogs because I forgot, sorry for that

Here’s what I did

  • I made the folder structure moduler having different modules for different logic : room, game, question
  • Shared files are in shared folder
  • Each module has its own listener, service, schema with some having util/helper file
  • I first worked on room then game then question
  • Some things are still left to do, but first I would like to make some of the frontend
0
0
3

Delete project?

Are you sure you want to permanently delete this project? This action cannot be undone.

All devlogs, followers, and associated data will be removed.

Followers

Loading…