ASCII Fortress 2

ASCII Fortress 2 2.0.0

DonutVikingChap

L5: Dapper Member
Mar 15, 2013
233
140
ASCII Fortress 2 - Online multiplayer game based on TF2 with ASCII graphics

10bda9d022.gif

This year I decided to do something a little bit special for the 72hr TF2 jam. ASCII Fortress 2 is a full-fledged online multiplayer game coded from scratch in C++17 using SFML 2.4.2, featuring ASCII console graphics (think Rogue from 1980) and real-time class-based gameplay with guns, complete with a console/command system for configuration and in-game chat!

The current version supports the following features:
- Online gameplay with up to 65535 players on the same server (limited to 24 by default)
- All 9 TF2 classes with unique gameplay styles
- A basic Capture the Flag gamemode
- 5 included maps
- The ability to make and download custom maps

I have recorded the entire coding process and will be uploading a timelapse video of it to YouTube sometime in the coming weeks. I will also be hosting a "main" server 24/7 for a few days so that anyone who wants to try the game has somewhere to play. To join the main server, simply press "Connect" in the join menu without changing the address. Have fun!
 
Last edited:

Nuke

L4: Comfortable Member
Jul 5, 2016
163
115
Last edited:

Crowbar

aa
Dec 19, 2015
1,455
1,298
What if...
Color maps? A text file with the same name as the map but different extension, with each byte representing the color it'd be in the main map? Like, using darker colors to detail OOB and stuff.
 

BeepSterr

L2: Junior Member
Jun 10, 2015
74
40
What if...
Color maps? A text file with the same name as the map but different extension, with each byte representing the color it'd be in the main map? Like, using darker colors to detail OOB and stuff.
Maybe floors or height difference can be done similarly?

So a map could be:
Code:
ctf_2fort_0.txt
ctf_2fort_1.txt
ctf_2fort_0.colors
ctf_2fort_1.colors
(or something like that)

Don't know if its actually a good idea to have multiple floors
/shrug
 

Crowbar

aa
Dec 19, 2015
1,455
1,298
Actually, you could write the Things like spawns and healthpacks into another map, so we aren't limited to like 10 numbers (and so we can use the numbers for detail!). That file could even be Unicode, so 2 bytes per a Thing so we have 65536 Thing types avaliable - sounds like a good reserve!
EDIT: I wrote that because I thought that the places that would take you to another height would also take up Thing codes. Also, need to do something with visibility and stuff to prevent camping... Actually, I don't quite like the idea of multiheightness.
 

zahndah

professional letter
aa
Jul 4, 2015
763
647
one height but with one way 'dropdowns' to fake height seems like itd be the best imo. You can do a lot with that and donut wouldnt have to do a whole visability thing for it.
 

BeepSterr

L2: Junior Member
Jun 10, 2015
74
40
Actually, you could write the Things like spawns and healthpacks into another map, so we aren't limited to like 10 numbers (and so we can use the numbers for detail!). That file could even be Unicode, so 2 bytes per a Thing so we have 65536 Thing types avaliable - sounds like a good reserve!
EDIT: I wrote that because I thought that the places that would take you to another height would also take up Thing codes. Also, need to do something with visibility and stuff to prevent camping... Actually, I don't quite like the idea of multiheightness.
one height but with one way 'dropdowns' to fake height seems like itd be the best imo. You can do a lot with that and donut wouldnt have to do a whole visability thing for it.
Yeah, I was just putting it out there, Multi-Height most likely wont work well.

About writing other things into other files, won't that be super annoying to set up because you'd have to guess where to put it exactly?
Unless the item file could be something like..
Code:
itemname, xcoord, ycoord

healthpack, 1, 5
blue_flag, 50, 50
red_flag 100, 100
healthpack, 5, 1
 

Crowbar

aa
Dec 19, 2015
1,455
1,298
I mean a map, not a list. An array of characters, exactly a text file. Like, #0 character (or a space for easier editing) for representing no entity there, etc.
EDIT: Got what you are saying actually. Hmm yes. A level editor would solve anything :p
 

DonutVikingChap

L5: Dapper Member
Mar 15, 2013
233
140
I actually have made a class for parsing files similar to Valve's "keyvalues" format for another one of my projects that I could theoretically just copy-paste into this and allow for entities to be defined in that way, but given how basic the maps/entities are in this game it feels kind of unnecessary to make a full-blown entity system and level editor instead of just simply placing numbers around the map file. I also feel like defining the entities in a separate "empty" map and having to switch back and forth for context is probably just gonna be annoying.

Anyway, 1.1.0 should be coming out pretty soon! I've fixed some stuff that was causing crashes on the server, fixed the sound system, and a ton of other stuff that should make the game a lot more playable, as well as (hopefully) an automatic way of downloading all the awesome maps you guys are creating!
 

DonutVikingChap

L5: Dapper Member
Mar 15, 2013
233
140
Version 1.1.0 is finally released. This version fixes some game-breaking bugs and adds the ability to auto-download custom maps!

Old versions:
1.0.0: https://www.dropbox.com/sh/dcrskdsdh19qtt5/AABCqQjQl3VL-KnTaiwnsnrYa?dl=1

Changelog:
- Made clients send a disconnect message in their destructor so that the server has a chance to be informed even if they didn't disconnect gracefully.
- Increased speed of soldier rockets.
- Reduced sentry fire rate.
- Fixed spies being able to kill people while dead.
- Increased flame damage.
- Increased flamethrower range.
- Made the "team" command accept "spec" as input.
- Empty chat messages no longer get sent.
- Added the ability to send chat messages from the server console.
- More information is now printed to the server console.
- Changed the way in-game sounds are loaded and played.
- Made PlaySound and chat messages use less network bandwidth.
- Refactored some ugly code.
- Changed the order in which projectiles are updated to allow for projectiles to be updated on the same frame as they were spawned.
- Reduced sentry gun server limit from 4294967295 to 65535.
- Increased brightness of spectator team color
- Increased engineer sentry build cooldown from 4 seconds to 6 seconds.
- Increased sentry health to 300
- Removed mp_player_health cvar and made different classes have different amounts of health. Their health amounts currently match their respective health amounts in TF2.
- Increased damage of projectiles to compensate for the increased player health.
- Made it so that you no longer need to choose class after choosing to spectate.
- Changed the loading of char matrix files (including maps) so that they don't ignore lines with double forward slashes.
- Made it so that you don't have to add the ".txt" extension to the map name when starting a server.
- Removed a bunch of spaces that were protruding to the right of map1.
- Fixed a server crash related to stickybombs.
- Added a "noclip" command.
- Made spectators able to move their viewport around the map.
- Fixed the volume slider not affecting sounds that have already been loaded.
- Separated explosions from projectiles and thereby fixed a bunch of bugs related to spawning explosions while iterating projectiles.
- Commands "team" and "class" now list all valid classes.
- Fixed config files adding an increasing number of spaces after command separators on every game shutdown.
- Made the server send less messages to unconnected clients.
- Made the client send less messages to the server before it has connected.
- Made the health number at the bottom of the screen more visible.
- Fixed mouse clicks registering even when the game window was out of focus.
- Added an "sv_hostname" cvar.
- Added player count, hostname and game version information to ServerInfo messages.
- Changed team/class select screens to make it more obvious what to type.
- Made the default player name an empty string, and added a message to the "Join Game" menu asking you to choose a username if you try to connect without changing it.
- Added a line of sight test to sentry guns so that they don't try to shoot players through walls.
- Increased heavy move speed.
- Increased demoman move speed.
- Made a Windows message box appear when the game displays an error message.
- Decreased engineer fire rate.
- Made the client spam unacked reliable messages less fequently.
- Fixed explosions being able to damage the same player/sentry multiple times.
- Made stickybombs land on the ground instead of exploding after a certain time.
- Decreased rocket range.
- Changed default server timeout to 10 seconds.
- Changed default client timeout to 10 seconds.
- Set a maximum length of networked strings.
- Changed client timeout message to "Server is not responding.".
- Added support for one-way colliders in maps by using the characters '<', '>', '^' and 'v'.
- Added respawnroom visualizers.
- Added resupply cabinets.
- Updated existing maps with the new available map features.
- Slightly increased heavy fire rate.
- Added an "sv_port" cvar.
- Added a "changelevel" command.
- Added a "maplist" command.
- Added a "status" command.
- Added a "banned_ips" configuration file.
- Messages are now distributed over multiple packets if there are too many to fit in one.
- Clients now automatically download the map from the server they are connecting to if they don't already have it installed. This can be disabled with cl_allow_map_download on the client or sv_allow_map_download on the server.
- Fixed clients sending the wrong number as their ack for reliable messages from the server.
- Added "download_url", "default_server_ip", "default_port" and "default_map" cvars.
- Removed test map "map2.txt" from the game download.
- Renamed "map1.txt" to "ctf_map1.txt".
- Added 4 new maps: "q3dm1.txt", "ctf_q3dm1.txt", "ctf_turbine.txt" and "ctf_zahn.txt".

Read the rest of this update entry...