- Joined
- Feb 18, 2010
- Messages
- 1,850 (0.36/day)
System Name | Eldritch |
---|---|
Processor | AMD Ryzen 5 5800X3D |
Motherboard | ASUS TUF X570 Pro Wifi |
Cooling | Satan's butthole after going to Taco Bell |
Memory | 64 GB G.Skill TridentZ |
Video Card(s) | Vega 56 |
Storage | 6*8TB Western Digital Blues in RAID 6, 2*512 GB Samsung 960 Pros |
Display(s) | Acer CB281HK |
Case | Phanteks Enthoo Pro PH-ES614P_BK |
Audio Device(s) | ASUS Xonar DX |
Power Supply | EVGA Supernova 750 G2 |
Mouse | Razer Viper 8K |
Software | Debian Bullseye |
I'm trying to make a turn-based game, and I'm trying to figure out how to communicate between the game and the graphics. Something along the lines of:
The real intention is that the game tells the graphics what is going on, and the graphics tells the game what the player wants to do, and I don't exactly know what the best way to go about this is. I was thinking maybe keeping them in seperate processes and using pipes to communicate the actions and chunks of shared memory for the map data and such.
I'm working with C in Linux (at the moment).
- Game tells graphics "It is Billy the NPC's turn. Billy the NPC moves over here and turns to face this way. It is now Tom the Monster's turn. Tom the Monster attacks John the PC and rolls an 18 and hits John the NPC. John the PC takes 8 points of damage from Tom the Monster's attack. It is now John the PC's turn."
- Graphics tells game "John the PC casts Spaceballs the Spell on Tom the Monster."
- Game tells graphics "John the PC's Spaceballs the Spell hits Tom the Monster. Tom the Monster makes a fortitude save of 13 and fails. Tom the Monster takes 12 points of Hurty damage and dies."
- Graphics tells game "John the PC's turn is over."
- Game tells graphics "Billy the NPC goes over this way and blotterizes his kajiggers. It's now John the PC's turn."
- Graphics tells game "John the PC moves over to this area."
- Game tells graphics "Load this area" and somehow hands over the map's data to the graphics
The real intention is that the game tells the graphics what is going on, and the graphics tells the game what the player wants to do, and I don't exactly know what the best way to go about this is. I was thinking maybe keeping them in seperate processes and using pipes to communicate the actions and chunks of shared memory for the map data and such.
I'm working with C in Linux (at the moment).