CrossTheLine
CrossTheLine
CC#
Created by CrossTheLine on 12/10/2023 in #help
At my wit's end with a Decision Tree (Unity)
Hi, I've been struggling with fixing this decision tree for a long while now, and it's currently past midnight. While I'll be heading to bed to save some of my own sanity, I would like to request assistance with fixing this tree please. I'm making a cardgame in Unity, and there's three outcomes an NPC player can make: Payment (Call/check), Retreat (Fold), Revolt (kinda like betting). The issue is, in spite of me attempting to tune values manually and lower the odds of revolting, I seem to have NPCs that always revolt every single time. I've not touched this decision tree in some time and it's a discipline I'm less experienced in, so the sheer amount of nodes and values are overwhelming me, as I had initially made this tree with the assistance of a more seasoned programmer. Please let me know what I'm doing wrong; I've checked the hand values and they seem to be returning that correctly so I believe the scope of the issue lies primarily within the decision tree and the nodes I've created inside of it. https://paste.mod.gg/wyypfbusgtih/0
1 replies
CC#
Created by CrossTheLine on 3/14/2023 in #help
❔ [Unity] Should I just move all my old scripts to another folder and start over?
To make a long story short, I'm making a game and there's two gamemodes. The first gamemode turns out to be unfun, and so I want to start working on the second one. Unfortunately, since I'm a beginner at this, I struggle with refactoring and the old code is so inextricably focused on the original gamemode, that none of it is useful or usable for the new gamemode I want to make use of. That being said, I want to start over but still keep the assets I've made in the project. This creates a bit of a problem that, there's SOME usable stuff in every script I've written so far, but there's a lot of unremovable dependencies I don't know how to refactor due to lack of skill + newbie spaghetti code. My initial thought is to just create a bunch of new scripts with different names, but in Unity, the script with the 'GameManager' name is pretty important in some vague way, because it even gets a unique icon when you make it. But my old GameManager is pretty screwed up, and I do kinda want to keep it around if I revisit the gamemode in future. I've got a few options here - moving the old scripts somewhere else and just making a 'different' gamemanager with its own name, or even starting a new project & reimporting the assets I've made in the original project. What should I do here?
4 replies
CC#
Created by CrossTheLine on 2/7/2023 in #help
✅ Best way to use and compare enums? (Unity)
Hi, currently working with enums in the ubiquitous poker-suit card game type setup that a lot of people have going on. Two main scripts are involved, the CardClass script and the GameManager script - and the main enum I want to focus on for now is 'Suits'. My main question is how best to compare it in the case of the player selecting different suits as their chosen suit. So if a player selects spades and then hearts, Clubs and Diamonds now treat the player differently in the game logic. Do I simply just have a line like using CardClass in the GameManager which grants me access to the same enum, and create a new variable in the manager to keep track of the player's chosen Suits enum?
40 replies