This tutorial needs work but hopefully this should get people started...
OK I've had this requested several times so here's how to modify the main menu, well at least the way I did it.
First you need to understand the concept in this post:
http://alienswarmsp.blogspot.com/2011/03/things-wot-i-have-learned.html?showComment=1317251578720#c5582811687366040367
Got it?
Good!
The blurred loading image:
Go open up the AS:SP download file and open up the Materials/Console/ folder.
You'll see a bunch of image files and a few .vtf and .vmt files.
If you don't know what .vtf file and .vmt files are then go to the valve wiki and look them up, then come back here and carry on reading this.
You will need to modify the code to make the game search for a different background image.
Search all .CPP files and look for the strings
selectionscreen.vtf
Selectionscreen.vmt
selectionscreen_widescreen.vtf
selectionscreen_widescreen.vmt
Alter each file reference name to the name of the files you will create to replace these.
I added ASSP to the beginning of each file of mine as you can see from my download.
To create my image I took a screenshot of a single frame of the background video I had selected to run (see below for how to change it). I then used Paint.net to add gauzien blur to blur the image and resize it.
Once you have your image, use Paint.net and the .vtf plugin from "nems tools" to convert your image into a vtf file and create your .vmt file. For the VMT file content just copy the content from my ASSP version.
The replicate and create the widescreen version of this, copying the dimensions of it's equivenlant you find in the .vpk.
Basically you just looking to replicate what's in the VPK file but with different file names and you're own images.
Does that make sense? I may re-write this later...
The Background Video
Alien Swarm uses a .bik format video file as the base layer to it's menu system. This .bik video can be changed but is not easily removed completely. The name of this file is set in the file "nb_header_footer.cpp".
The video panel basically forms the base layer of the entire menu system in the code. You can punch through the menu system to the game port screen below by removing the video reference completely from the nb_header_footer.cpp file but that also removes all the menu elements completely. Not very helpful at all.
If you are attempting to create a background map for your menu then I would recommend you record your background map in game, convert it to a .bik video file and then use it as your backgroup for your menu.
Changing The Menu Options
First off you need to understand that in order for the game to support multiple languages, a menu option and the text label that shows up on the menu are two seperate things.
For example. The function of Option 1 is to start a new game. However the text that appears in the menu will depend on your game language selection and each set of potential language values is defined in a different file.
There is a file for English, A file for Spanish, A file for German and so on.
So if we want to modify the options for the main menu then we need to make changes at several levels.
Mainmenu.res
This file can be found in the \resource\ui\basemodui directory in the VPK files.
When you open it you'll see a bunch of sets of script that look like this:
"BtnSingleplayer"
{
"ControlName" "BaseModHybridButton"
"fieldName" "BtnSingleplayer"
"xpos" "100"
"ypos" "280"
"wide" "210"
"tall" "13"
"autoResize" "1"
"pinCorner" "0"
"visible" "0"
"enabled" "1"
"tabPosition" "0"
"navUp" "PnlQuickJoin"
"navDown" "BtnMultiplayer"
"labelText" "#L4D360UI_MainMenu_PlaySolo"
"tooltiptext" "#L4D360UI_MainMenu_PlaySolo_Tip"
"style" "AlienSwarmMenuButtonSmall"
"command" "SoloPlay"
"ActivationType" "1"
}
Each line here is a parameter that defines where on the screen this option will appear and what it will do when you click on it.
In the case of the set above, It's the button that activates single player mode (offline practice mode) in Alien Swarm.
You can see the system command is "Soloplay".
The "Visible" option here is very helpful. It will allow you to make an option visible or not (obviously). So by switching certain options on and off you can modify your main menu.
Check out this Valve wiki page for more info on the main menu set up.
The most important bit of info defined here though is the "labeltext". This is what links this menu item to the lanugage files we'll look at next.
basemodui_english.txt
basemodui_english.txt is the file that defines all the english text in the game. It can be found in the Resource folder at the top level and the good news is, it's not in the VPK file so you don't need to change any code this time.
Open the file and search for the "labeltext" we used above but before you do, remove teh # symbol.
So it should look like "L4D360UI_MainMenu_PlaySolo"
Should look like this:
"L4D360UI_MainMenu_PlaySolo" "PLAY AS:SP"
on the right next to this reference you'll see the UK language text that will appear in your menu.
For my mod I just changed the text from "Offline Practice" to "Play AS:SP".
Hope this is helpful. Lemme know if you want to know anything else....
The problem with Alien Swarm is that its multiplayer by default. As the community gets bored with the official campaign they move on and pretty soon theres no one to play with anymore. Take away the multiplayer and you have a great top down shooter. I give you Alien Swarm: Single Player... enjoy!
Download Alien Swarm SP
Alien Swarm SP is available for download via the link below:
Download
And here's more new levels to play through than you'll ever need!
Swarm Armory Map Database
Here's the contents of the Readme.txt
Alien Swarm SP by Aazell
Installation Instructions:
1: You must have an up to date version of Alien Swarm installed on Steam in order to play Alien Swarm SP
Extract the contents of AlienSwarmSP.rar to the following folder in your Steam directory.
\Steam\steamapps\sourcemods\
Now restart Steam and you should see Alien Swarm SP available in your games library.
Launching a map in Alien Swarm SP:
From the main menu of Alien Swarm SP select Play AS:SP option and you should see the mission selection screen. All addon campaigns (if you have installed any and activated them) should be available within this screen also.
I have encountered no bugs (heh heh) as yet but if you do please send an e-mail to aazell1@gmail.com giving as much information as you can and I will attempt to investigate the problem.
Hope you have fun with it...
Download
And here's more new levels to play through than you'll ever need!
Swarm Armory Map Database
Here's the contents of the Readme.txt
Alien Swarm SP by Aazell
Installation Instructions:
1: You must have an up to date version of Alien Swarm installed on Steam in order to play Alien Swarm SP
Extract the contents of AlienSwarmSP.rar to the following folder in your Steam directory.
\Steam\steamapps\sourcemods\
Now restart Steam and you should see Alien Swarm SP available in your games library.
Launching a map in Alien Swarm SP:
From the main menu of Alien Swarm SP select Play AS:SP option and you should see the mission selection screen. All addon campaigns (if you have installed any and activated them) should be available within this screen also.
I have encountered no bugs (heh heh) as yet but if you do please send an e-mail to aazell1@gmail.com giving as much information as you can and I will attempt to investigate the problem.
Hope you have fun with it...
Thursday, 29 September 2011
Wednesday, 23 March 2011
AS:SP Map Review Criteria
I will be reviewing a bunch of the most popular maps and campaigns created by the community on this site. My reviewing critera may upset a few mappers out there but I believe they are valid. In my opinion a good map is not the best looking or the most complex. A good map is a map that the player has fun playing. Fun can be destroyed in so many ways.... heres my main list of sins that I'll be looking out for.
1. Lack of direction to the player
The Lara Croft Sin
The player is forced to wander around the map desperately trying the most stupid actions in order to progress through the game simply because the mapper didnt make it clear what the player was supposed to be doing.
2. The Pinball Wizard
The player is continually backing up into props and junk in the main play area because the map is too dark and too cluttered. For gods sake people, keep the play area clear of obstructions!
3. No Rest For The Wicked
No break areas are provided. Swarm continue to harass the player regardless of where-ever they are in the map. Think of them like the safe rooms in Left 4 Dead. Theyre essential to good game play and allow the team to regroup.
4. It's All Too Much!
The mapper is a hardcore player of AS and designs his maps to his own difficulty level. Maps should be challenging but not onslaught crazy! Getting this balance right is essential for fun to bloom!
5: Go Back Young Man!
A dead end forces the player to backtrack through the same area of the map. Bad news and boring for players. You might get away with it if the play is changed dramatically but it very rarely works. Always provide a different exit.
6: Looks...
Yes its only number six on the list.. deal with it!
I want to feel lost in the environment. Doesnt matter if its an ugly environment. If its good enough that it doesnt distract from gameplay then its good enough for me.
7. Sound
Sound adds another dimension to the world. If you couldnt be arsed to add ambient sounds your going to lose points.
8: Tell me a Story!
In order to be drawn into a map Im going to need a decent story. Additional points if the story is progressed during the map itself through datapads, voiceovers, screentext etc...
Busy life at the moment so will take me a little while to get reviews out the door. In the mean time if any readers want to comment on AS:SP playing experiences with certain custom maps, send me your thoughts and I'll post them up here!
1. Lack of direction to the player
The Lara Croft Sin
The player is forced to wander around the map desperately trying the most stupid actions in order to progress through the game simply because the mapper didnt make it clear what the player was supposed to be doing.
2. The Pinball Wizard
The player is continually backing up into props and junk in the main play area because the map is too dark and too cluttered. For gods sake people, keep the play area clear of obstructions!
3. No Rest For The Wicked
No break areas are provided. Swarm continue to harass the player regardless of where-ever they are in the map. Think of them like the safe rooms in Left 4 Dead. Theyre essential to good game play and allow the team to regroup.
4. It's All Too Much!
The mapper is a hardcore player of AS and designs his maps to his own difficulty level. Maps should be challenging but not onslaught crazy! Getting this balance right is essential for fun to bloom!
5: Go Back Young Man!
A dead end forces the player to backtrack through the same area of the map. Bad news and boring for players. You might get away with it if the play is changed dramatically but it very rarely works. Always provide a different exit.
6: Looks...
Yes its only number six on the list.. deal with it!
I want to feel lost in the environment. Doesnt matter if its an ugly environment. If its good enough that it doesnt distract from gameplay then its good enough for me.
7. Sound
Sound adds another dimension to the world. If you couldnt be arsed to add ambient sounds your going to lose points.
8: Tell me a Story!
In order to be drawn into a map Im going to need a decent story. Additional points if the story is progressed during the map itself through datapads, voiceovers, screentext etc...
Busy life at the moment so will take me a little while to get reviews out the door. In the mean time if any readers want to comment on AS:SP playing experiences with certain custom maps, send me your thoughts and I'll post them up here!
Monday, 14 March 2011
My thoughts on custom maps...
I've spent the last few days playing every custom map I can get my hands on. The initial reason for this was to recommend and not recommend maps that work with AS:SP.
I began to write a post detailing my findings on each map. My writings began to look like a serious review of each map. Then I stopped...
I have no wish to piss off the rest of the AS mapping community by arrogantly passing judgement on individual maps. It's not as if I've done better or produced any maps that were noteworthy.
There are a few points however that I'd like to get off my chest.
What's The Story, Morning Glory?
With the exception of the objectives and the overview briefing screen I've yet to find a single custom map that attempts to provide any kind of story to engage the players. A good story may seem to be unnecessary when players are going to be simply joining a map and blasting their way through it but I disagree with this. A story is what drives the players along. Give purpose to their actions. With a good story I feel you can take a standard bunch of online players and transport them to a different place and time and really engage with the game.
There have to be consequences to the players actions (other than being made to look a fool by dieing in the first 2 mins) or the whole game is pointless.
Where Do We Go From Here?
The second thing that I noticed about the majority of the maps is that they lack any kind of clear and sutble direction on where the hell you should be going. It's a number one rule among game designers. The worst sin you can commit is to leave the player confused as to what they should be doing. The game should never be, trying to work out what to do. It should be about the skill it takes to achieve your goal.
By simply lighting up important areas or using some other method to draw the players attention to it, you can save an awful lot of headaches.
This shouldn't be hitting them over the head with a sledge hammer either. There should be no big arrows or on screen text saying GO TO HERE! Never the less, through smart use of textures and lighting you can make it very obvious as to where the player is trying to get to and how to get there.
Alone In The Dark
One last observation I made about many maps was that they were seriously underlit. It's one thing to try and create a creepy or threatening atmosphere, it's another to leave the player in almost total darkness surrounded by annoying map items so that they have to bump their way through a map like some overcomplicated pin ball wizard.
Regardless of the setting or the mood or whether the players have flashlights or not there really is no excuse for not lighting up every corner of your map at all times.
It doesn't have to be fullbright but it does have to be well defined to prevent the players falling over themselves...
Nut Up Or Shut Up
Ok so now I've spouted on about the problems with the current crop of custom maps I should probably put my money where my mouth is.
With this in mind I'm building a simple series of maps for people to playtest (either MP or SP) that will hopefully manage to not break each of the rules above.
My maps will have an engaging story, the players path will be clear at all times without feeling linear and all areas of the map will be appropriately well lit.
Gulp... what have I let myself in for???!
I began to write a post detailing my findings on each map. My writings began to look like a serious review of each map. Then I stopped...
I have no wish to piss off the rest of the AS mapping community by arrogantly passing judgement on individual maps. It's not as if I've done better or produced any maps that were noteworthy.
There are a few points however that I'd like to get off my chest.
What's The Story, Morning Glory?
With the exception of the objectives and the overview briefing screen I've yet to find a single custom map that attempts to provide any kind of story to engage the players. A good story may seem to be unnecessary when players are going to be simply joining a map and blasting their way through it but I disagree with this. A story is what drives the players along. Give purpose to their actions. With a good story I feel you can take a standard bunch of online players and transport them to a different place and time and really engage with the game.
There have to be consequences to the players actions (other than being made to look a fool by dieing in the first 2 mins) or the whole game is pointless.
Where Do We Go From Here?
The second thing that I noticed about the majority of the maps is that they lack any kind of clear and sutble direction on where the hell you should be going. It's a number one rule among game designers. The worst sin you can commit is to leave the player confused as to what they should be doing. The game should never be, trying to work out what to do. It should be about the skill it takes to achieve your goal.
By simply lighting up important areas or using some other method to draw the players attention to it, you can save an awful lot of headaches.
This shouldn't be hitting them over the head with a sledge hammer either. There should be no big arrows or on screen text saying GO TO HERE! Never the less, through smart use of textures and lighting you can make it very obvious as to where the player is trying to get to and how to get there.
Alone In The Dark
One last observation I made about many maps was that they were seriously underlit. It's one thing to try and create a creepy or threatening atmosphere, it's another to leave the player in almost total darkness surrounded by annoying map items so that they have to bump their way through a map like some overcomplicated pin ball wizard.
Regardless of the setting or the mood or whether the players have flashlights or not there really is no excuse for not lighting up every corner of your map at all times.
It doesn't have to be fullbright but it does have to be well defined to prevent the players falling over themselves...
Nut Up Or Shut Up
Ok so now I've spouted on about the problems with the current crop of custom maps I should probably put my money where my mouth is.
With this in mind I'm building a simple series of maps for people to playtest (either MP or SP) that will hopefully manage to not break each of the rules above.
My maps will have an engaging story, the players path will be clear at all times without feeling linear and all areas of the map will be appropriately well lit.
Gulp... what have I let myself in for???!
Friday, 11 March 2011
Over 150 downloads... woot!
I'm really quite happy with the response to the mod so far...
I've actually released very little to the open web in my time as mapper. I tend to get a certain way through a map then lose the passion for it. I've realised since it is because I don't prepare properly.. the trick to finishing a map is to know the whole layout before you even open Hamme for the first time.
Well I supposed it's a double edged sword in some respects. My user base must be cared for now, I'm sure they're a greedy bunch. Let's hope we keep the content flow at a decent enough pace to keep peeps happy.
To be honest I've only been contacted by two of the 150 people that have downloaded this.
No news is good news???
I would actually like to hear from anyone who's used the mod and try and put together a wish list for the next version.
I've actually released very little to the open web in my time as mapper. I tend to get a certain way through a map then lose the passion for it. I've realised since it is because I don't prepare properly.. the trick to finishing a map is to know the whole layout before you even open Hamme for the first time.
Well I supposed it's a double edged sword in some respects. My user base must be cared for now, I'm sure they're a greedy bunch. Let's hope we keep the content flow at a decent enough pace to keep peeps happy.
To be honest I've only been contacted by two of the 150 people that have downloaded this.
No news is good news???
I would actually like to hear from anyone who's used the mod and try and put together a wish list for the next version.
Support: Custom Maps
I had some feedback today that reminded me I hadn't actually pointed out to users that they would need to install any custom maps they wanted to play into the AlienSwarmSp directory.
AS:SP is smart, but it's not smart enough to go looking in the offical game directory Addons folder for any custom maps you might have downloaded.
So in order to play custom maps you're going to have to create a folder called "Addons" in the AlienSwarmSP folder, then move your custom map .vpk's in there in order for them to show up in the mission selection screen.
I will be updating the current version of AS:SP tonight so that the standard package comes with the "Addons" folder included and instructions in the Readme.txt file.
Until then use this post as direction...
AS:SP is smart, but it's not smart enough to go looking in the offical game directory Addons folder for any custom maps you might have downloaded.
So in order to play custom maps you're going to have to create a folder called "Addons" in the AlienSwarmSP folder, then move your custom map .vpk's in there in order for them to show up in the mission selection screen.
I will be updating the current version of AS:SP tonight so that the standard package comes with the "Addons" folder included and instructions in the Readme.txt file.
Until then use this post as direction...
Thursday, 10 March 2011
Getting back to the beginning...
I've finally gotten all the functionality I wanted in place for me to build my map.
See all this began with a simple idea. Treat Alien Swarm as a top down Half-Life.
A single marine based map focussing on exploration and puzzle based gaming.
There were several things in the way of that.
1: The player selection screen and the ability for players to seleft their own weapons.
2: The offscreen player arrows which meant I couldnt place bots elsewhere in my map or the player would know they were there.
3: No ability to create cutscenes therefore difficult to tell a story
4: No other Human NPC's
Not sure if I can do much about 4. I will continue to check out the code but I think I've reached a point where I can crack on with mapping and be happy that the player experience will be what I wanted originally.
See all this began with a simple idea. Treat Alien Swarm as a top down Half-Life.
A single marine based map focussing on exploration and puzzle based gaming.
There were several things in the way of that.
1: The player selection screen and the ability for players to seleft their own weapons.
2: The offscreen player arrows which meant I couldnt place bots elsewhere in my map or the player would know they were there.
3: No ability to create cutscenes therefore difficult to tell a story
4: No other Human NPC's
Not sure if I can do much about 4. I will continue to check out the code but I think I've reached a point where I can crack on with mapping and be happy that the player experience will be what I wanted originally.
Monday, 7 March 2011
Cutscenes are mine at last!
What would a single player game be without a decent cutscene or two?
A bit rubbish if you ask me. Up till now it's been thought that Alien Swarm didn't come with any entities that allowed you to project an image to the full screen. I.e. present a camera driven scene to the players full screen.
The only thing that was provided was a small pop out camera screen at the side..
Well after a lot of tinkering I discovered that the image that was shown on that pop out video is actually a texture. That texture can be applied to any surface in a map by turning the brush you want it to appear on into a func_monitor, covering all sides in nodraw texture then applying the texture vgui/swarm/Computer/ComputerCamera.vtf to the side of the brush where you want the image to appear.
Nice... What's even nicer is if you use that image as an env_screenoverlay you can fill the players whole screen with the camera feed...
Here's a BSP map file for those who want to see the results... just drop it into your alien swarm maps folder.
Here's a .vmf map file for those that want to see how it's done.
Ahh I can now go to bed with a sense of achievement!
Update!
I have managed to create a new .VMT file that removes the security camera style overlay. It can be downloaded Here!
A bit rubbish if you ask me. Up till now it's been thought that Alien Swarm didn't come with any entities that allowed you to project an image to the full screen. I.e. present a camera driven scene to the players full screen.
The only thing that was provided was a small pop out camera screen at the side..
Well after a lot of tinkering I discovered that the image that was shown on that pop out video is actually a texture. That texture can be applied to any surface in a map by turning the brush you want it to appear on into a func_monitor, covering all sides in nodraw texture then applying the texture vgui/swarm/Computer/ComputerCamera.vtf to the side of the brush where you want the image to appear.
Nice... What's even nicer is if you use that image as an env_screenoverlay you can fill the players whole screen with the camera feed...
Here's a BSP map file for those who want to see the results... just drop it into your alien swarm maps folder.
Here's a .vmf map file for those that want to see how it's done.
Ahh I can now go to bed with a sense of achievement!
Update!
I have managed to create a new .VMT file that removes the security camera style overlay. It can be downloaded Here!
Saturday, 5 March 2011
Beta 0.2 Almost Ready
We're in a fast development cycle over here at AS:SP. Beta 0.2 is compiling as I type this.
0.2 is a functionality update really. I've changed the main menu buttons, loading screen and background video so when you're playing AS:SP you know you're playing it and not regular Alien Swarm.
plaYer2K has worked his magic and taken my altered code and bundled it in with his better HUD mod.
Loading Screen
Main Menu
If you want to mod Alien Swarm you can't do better than start with the Hud mod. It's added so many more configurable elements therefore avoiding the need for coding.
I'll wait for him to announce what he's added but it really opens up the opportunities for changing the look and feel of the game menus etc..
We seem to have developed a rather odd partnership. I change code in my mod.. tell him what I've changed.. he then decides which elements he'd like to mod further and make it changable through a config file which then gets passed on to you guys through the Better Hud Mod. Everybody wins! :)
Anyway... hoping Beta 0.2 will be out later today... stay tuned!
0.2 is a functionality update really. I've changed the main menu buttons, loading screen and background video so when you're playing AS:SP you know you're playing it and not regular Alien Swarm.
plaYer2K has worked his magic and taken my altered code and bundled it in with his better HUD mod.
Loading Screen
Main Menu
If you want to mod Alien Swarm you can't do better than start with the Hud mod. It's added so many more configurable elements therefore avoiding the need for coding.
I'll wait for him to announce what he's added but it really opens up the opportunities for changing the look and feel of the game menus etc..
We seem to have developed a rather odd partnership. I change code in my mod.. tell him what I've changed.. he then decides which elements he'd like to mod further and make it changable through a config file which then gets passed on to you guys through the Better Hud Mod. Everybody wins! :)
Anyway... hoping Beta 0.2 will be out later today... stay tuned!
Friday, 4 March 2011
Modding game code isnt that hard. Give it a try!
Before 2 weeks ago I had never attempted modding, especially changing the game code and recompiling.
It's a bit of a hurdle that some folks aren't willing to jump but trust me... it's really not that difficult.
If you cock it up at any point you just delete the mod folder and start again.
I've noticed quite a bit of coder snobbery in the HL2 modding community that can also make it difficult to get into coding. There's a general attitude of "I had to learn it so you should go through the same pain". I disagree with this. Once you've worked something out, write up a quick tutorial on it and post it to the web so that others can be saved the pain. If they're not willing to learn then fair enough... give em a little attitude.
I do understand the frustration of coders though. Young bright eyed kids hit the forums with good and bad ideas without any comprehension of how much work would be involved to achieve what they want. They often also have no desire to learn how to do the work for themselves and an expectation that coders have nothing better to do than make their dreams come true.
I'll be writing up a tutorial on beginner modding and altering code for Alien Swarm shortly.
But until then here's some assumption smashed...
Altering game code requires a knowledge of how to write c++ code!
BULLSHIT!
The majority of people who create mods and edit the game code wouldn't know how to write a new application in c++. All they do is tweak the code or cut and paste already written code from another valve game into the existing game code in order to create new functionality. You simply need a basic knowledge of the general coding concepts, structure of c++ and be willing to pull the code apart and break it down into understandable chunks.
Learning how c++ works through looking at Alien Swarm code is incredibly difficult, dont try! (as per valve SDK website)
BULLSHIT!
I would say that you'll learn a lot more from looking at code in a working application than following some tutorial that helps you print out "Hello World!" in the windows command console.
It takes an especially brainy person to understand and write code!
BULLSHIT!
I don't believe in the concept of "brainy". Anyone can do anything given time, curiosity and a clear goal. It takes a coder with experience to write good code but isn't that the way with everything. Someone who's been doing something for a long time will be better at it. That's the way of the world and everyone has to start somewhere.
So go ahead, create a mod, install Visual Studio Express 2008. Compile it, then start messing around with the variables. See what you can create!
It's a bit of a hurdle that some folks aren't willing to jump but trust me... it's really not that difficult.
If you cock it up at any point you just delete the mod folder and start again.
I've noticed quite a bit of coder snobbery in the HL2 modding community that can also make it difficult to get into coding. There's a general attitude of "I had to learn it so you should go through the same pain". I disagree with this. Once you've worked something out, write up a quick tutorial on it and post it to the web so that others can be saved the pain. If they're not willing to learn then fair enough... give em a little attitude.
I do understand the frustration of coders though. Young bright eyed kids hit the forums with good and bad ideas without any comprehension of how much work would be involved to achieve what they want. They often also have no desire to learn how to do the work for themselves and an expectation that coders have nothing better to do than make their dreams come true.
I'll be writing up a tutorial on beginner modding and altering code for Alien Swarm shortly.
But until then here's some assumption smashed...
Altering game code requires a knowledge of how to write c++ code!
BULLSHIT!
The majority of people who create mods and edit the game code wouldn't know how to write a new application in c++. All they do is tweak the code or cut and paste already written code from another valve game into the existing game code in order to create new functionality. You simply need a basic knowledge of the general coding concepts, structure of c++ and be willing to pull the code apart and break it down into understandable chunks.
Learning how c++ works through looking at Alien Swarm code is incredibly difficult, dont try! (as per valve SDK website)
BULLSHIT!
I would say that you'll learn a lot more from looking at code in a working application than following some tutorial that helps you print out "Hello World!" in the windows command console.
It takes an especially brainy person to understand and write code!
BULLSHIT!
I don't believe in the concept of "brainy". Anyone can do anything given time, curiosity and a clear goal. It takes a coder with experience to write good code but isn't that the way with everything. Someone who's been doing something for a long time will be better at it. That's the way of the world and everyone has to start somewhere.
So go ahead, create a mod, install Visual Studio Express 2008. Compile it, then start messing around with the variables. See what you can create!
Things wot I have learned...
Will be writing a tutorial on all I've discovered over the past two days. I've learned so much I dont know where to begin.
VPK revelations
Finally worked out why many things I changed in my mod had no effect in the game. It's all about the VPK.
The VPK files in the Swarm directory of the official game are like a big zip file. Each file in the VPK has parts spread over all of them. In order to know where each part of each file is the game refers to the GCF file. The GCF file is like a guide as to how to read the VPK files. It tells the game where to find all the bits of the file have been stored in the various VPK files.
So when you extract a file from the VPK file and place it in your mod the engine gets confused and makes some assumptions. If it finds a file in your mod directory that normally resides in the VPK then it assumes that it doesnt have to look in the VPK at all. As a result your mod will go all funny because its not finding a shed load of the files it needs.
The way around this is to change the name of the reference file the engine has to look for and then save your modded file under that name.
So for example, if I want to mod mainmenu.res I search the code for that name appearing in a particular .cpp file, change the code to look for mainmenu_mymod.res, then compile. Then I extract mainmenu.res from the swarm VPK file, make my changes and save it to my mod directory as mainmenu_mymod.res.
Now the game has no where else to look but my mod directory.
Build vs Rebuild
This is funny. I really didnt understand the difference between the Build option and the Rebuild option in Visual Studio. As a result I was hitting rebuild each time then waiting nearly an hour for my mod to recompile everything. Hit build and it will only compile the files youve changed and takes 2 mins. LOL I am a twat...
VPK revelations
Finally worked out why many things I changed in my mod had no effect in the game. It's all about the VPK.
The VPK files in the Swarm directory of the official game are like a big zip file. Each file in the VPK has parts spread over all of them. In order to know where each part of each file is the game refers to the GCF file. The GCF file is like a guide as to how to read the VPK files. It tells the game where to find all the bits of the file have been stored in the various VPK files.
So when you extract a file from the VPK file and place it in your mod the engine gets confused and makes some assumptions. If it finds a file in your mod directory that normally resides in the VPK then it assumes that it doesnt have to look in the VPK at all. As a result your mod will go all funny because its not finding a shed load of the files it needs.
The way around this is to change the name of the reference file the engine has to look for and then save your modded file under that name.
So for example, if I want to mod mainmenu.res I search the code for that name appearing in a particular .cpp file, change the code to look for mainmenu_mymod.res, then compile. Then I extract mainmenu.res from the swarm VPK file, make my changes and save it to my mod directory as mainmenu_mymod.res.
Now the game has no where else to look but my mod directory.
Build vs Rebuild
This is funny. I really didnt understand the difference between the Build option and the Rebuild option in Visual Studio. As a result I was hitting rebuild each time then waiting nearly an hour for my mod to recompile everything. Hit build and it will only compile the files youve changed and takes 2 mins. LOL I am a twat...
Wednesday, 2 March 2011
Instant Health and Ammo Pick-ups to add to your maps
OK I made these a while back.
These are instant pick-ups for your marines. Basically the old school arcade game floating, rotating icons that when you walk over them you get an instant health or ammo top up.
I'll explain how they work using the instant health.vmf
Visual Elements
The pick-up icon is basically a prop_dynamic set to "not solid" of the standard heath kit you can pick up in the game. It's orientated vertically and then parented to a func_rotating which is covered in the nodraw texture. I added a point_spotlight to it just to make it a bit glowy. I've parented the model and the point_spotlight to the func_rotating so that the model and the light rotate. Suggest you play with settings on the point_spotlight as it's a little bright.
Audio elements
I've added a asw_ambient_generic with the standard health pack application sound to the entity so this will play when health boost hits.
The health top up
The actual health top up is done through a server command. To do this we need to include a point_servercommand entity to your map. You'll only need one point_servercommand per map you build. I've included one in the .vmf file.
Also in order to issue the command that tops up the marines heath we need to have cheats enabled so be sure to include the sv_cheats 1 command in your map config file (see here for how map specific config files work in this mod).
The trigger
A standard trigger_once as we will only be using this pick up the one time.
How it all comes together
So the player walks into the trigger, the trigger has the following outputs:
-Play sound
-Send servercommand asw_gimme_health (refills the health of all marines)
-Kill prop_rotating (which in turn kills all entities parented to it, i.e. the model and the point_spotlight)
And we're done...
The insta_ammo.vtf does exactly the same thing except the model is changed for an ammo box. I changed the colour of the point_spotlight to differentiate them and the command it fires is asw_gimme_ammo.
Hope you choose to include them in your AS:SP map.
Cheers
Here's the links to download the .vmf's
Insta_health.vmf
Insta_ammo.vmf
These are instant pick-ups for your marines. Basically the old school arcade game floating, rotating icons that when you walk over them you get an instant health or ammo top up.
I'll explain how they work using the instant health.vmf
Visual Elements
The pick-up icon is basically a prop_dynamic set to "not solid" of the standard heath kit you can pick up in the game. It's orientated vertically and then parented to a func_rotating which is covered in the nodraw texture. I added a point_spotlight to it just to make it a bit glowy. I've parented the model and the point_spotlight to the func_rotating so that the model and the light rotate. Suggest you play with settings on the point_spotlight as it's a little bright.
Audio elements
I've added a asw_ambient_generic with the standard health pack application sound to the entity so this will play when health boost hits.
The health top up
The actual health top up is done through a server command. To do this we need to include a point_servercommand entity to your map. You'll only need one point_servercommand per map you build. I've included one in the .vmf file.
Also in order to issue the command that tops up the marines heath we need to have cheats enabled so be sure to include the sv_cheats 1 command in your map config file (see here for how map specific config files work in this mod).
The trigger
A standard trigger_once as we will only be using this pick up the one time.
How it all comes together
So the player walks into the trigger, the trigger has the following outputs:
-Play sound
-Send servercommand asw_gimme_health (refills the health of all marines)
-Kill prop_rotating (which in turn kills all entities parented to it, i.e. the model and the point_spotlight)
And we're done...
The insta_ammo.vtf does exactly the same thing except the model is changed for an ammo box. I changed the colour of the point_spotlight to differentiate them and the command it fires is asw_gimme_ammo.
Hope you choose to include them in your AS:SP map.
Cheers
Here's the links to download the .vmf's
Insta_health.vmf
Insta_ammo.vmf
Main Menu continues to frustrate.
Spent another 4 hours tweaking code to try and get those damn background movies to go away. Managed to find the .cpp file that controls them. Can change the movie that shows up by default to one that does not show the Alien Swarm logo in it. This has potential as I can then float the mod title graphic over the top of it. But at the end of the day thats not what I really want. I want to see the background map so will continue plugging on until I get it.
Got very excited when I found a .res file that has a setting to make the movie file visible or not visible, that didn't work unfortunatley. Then with help from Nightgunner I managed to uncover a value setting for movie_enabled. Set it to false. Recompiled.... didnt work...
Grrrr... once I crack this Im building in a CVAR so that mappers can swich the background movies on or off as they see fit. No one else should have to go through this pain.
I have everything else in place...
My background map movie is up and running.
It's a simple concept. A single marine model stands alone on a completely black background with a single spotlight shining down on it. The camera then moves around the model, slowley up from the feet to the head, rotates aound etc...
All this with a soundtrack playing of a bugle playing The Last Post.
Should be pretty cool...
Got very excited when I found a .res file that has a setting to make the movie file visible or not visible, that didn't work unfortunatley. Then with help from Nightgunner I managed to uncover a value setting for movie_enabled. Set it to false. Recompiled.... didnt work...
Grrrr... once I crack this Im building in a CVAR so that mappers can swich the background movies on or off as they see fit. No one else should have to go through this pain.
I have everything else in place...
My background map movie is up and running.
It's a simple concept. A single marine model stands alone on a completely black background with a single spotlight shining down on it. The camera then moves around the model, slowley up from the feet to the head, rotates aound etc...
All this with a soundtrack playing of a bugle playing The Last Post.
Should be pretty cool...
Tuesday, 1 March 2011
Main Menu Frustration
Had some feedback that the main menu page should be altered to show the name or the mod and the Play Online option should be removed. They are of course correct and its been on my mind for a while.
So, last night I delved into the horrid black hole that is the Alien Swarm Main Menu. And quite frankly its a pig to edit.
Half life 2's main menu was a joy to work with. After an hours work I could have a cool looking background map with new options showing and even get a logo up there... job done.
Not so with Alien Swarm. Changing the menu options should be as easy as modifying the mainmenu.res, gamemenu.res and the english translation.txt file. All do-able in a text editor.
However, every time I change any of these the menus get corrupted and the flyout menus (the menus that pop out from the side of the main options) go all funky and become unusable. Most frustrating.
The other immensly frustrating thing is that the bacground for the menu is a .bik video file. I need to get this disabled so that the regular viewport is available.
A very nice man working on the fantastic Jastain Summer mod sent me their modified mainmenu code. Have tinkered with this and managed to break my mod about 8 times.
I know I'll get there in the end. I always do but its so frustrating that something so simple as modifying a menu could be so damned hard and unintuative.
Ok a little tip for anyone planning to release a free game that you hope the modding community will keep alive...
DON'T HARD CODE SIMPLE STUFF LIKE MENU MODIFICATION!
OK rant over and it's back to work for me.
So, last night I delved into the horrid black hole that is the Alien Swarm Main Menu. And quite frankly its a pig to edit.
Half life 2's main menu was a joy to work with. After an hours work I could have a cool looking background map with new options showing and even get a logo up there... job done.
Not so with Alien Swarm. Changing the menu options should be as easy as modifying the mainmenu.res, gamemenu.res and the english translation.txt file. All do-able in a text editor.
However, every time I change any of these the menus get corrupted and the flyout menus (the menus that pop out from the side of the main options) go all funky and become unusable. Most frustrating.
The other immensly frustrating thing is that the bacground for the menu is a .bik video file. I need to get this disabled so that the regular viewport is available.
A very nice man working on the fantastic Jastain Summer mod sent me their modified mainmenu code. Have tinkered with this and managed to break my mod about 8 times.
I know I'll get there in the end. I always do but its so frustrating that something so simple as modifying a menu could be so damned hard and unintuative.
Ok a little tip for anyone planning to release a free game that you hope the modding community will keep alive...
DON'T HARD CODE SIMPLE STUFF LIKE MENU MODIFICATION!
OK rant over and it's back to work for me.
Sunday, 27 February 2011
For Mappers: Removing the Offscreen teammate arrows
In order to make the Using Bots As Power-Ups idea I ran across a problem.
If you spawn a bot elsewhere in the map you get an annoying arrow pointing to their location. That's just annoying and spoils the illusion..
So I asked plaYer2k very nicely if he could add a CVAR to his HUD mod that allowed the user to switch these arrows off. You know what... he said YES!!!
.. and here it is
asw_arrows_for_offscreen_teammates 0
this command switches off the arrows.
asw_arrows_for_offscreen_teammates 1
switches them back on again.
Just add these to your map config file if you want to start your map with this disabled.
This also leads to a very interesting idea. You can spawn 4 players. In different locations and have them run into each other at various points of the map.
So it's like 4 players playing a single player game that affect each other at various points.
For example. Player 1 moves forward through his map and reaches a particular trigger or button. This opens or closes a particular route for player 2. Player 2 is then forced to intersect with player 3's map, or pass over the top of it etc..
at the end of the map the team meet up in the middle for a nice big finale battle.
Just a thought!
If you spawn a bot elsewhere in the map you get an annoying arrow pointing to their location. That's just annoying and spoils the illusion..
So I asked plaYer2k very nicely if he could add a CVAR to his HUD mod that allowed the user to switch these arrows off. You know what... he said YES!!!
.. and here it is
asw_arrows_for_offscreen_teammates 0
this command switches off the arrows.
asw_arrows_for_offscreen_teammates 1
switches them back on again.
Just add these to your map config file if you want to start your map with this disabled.
This also leads to a very interesting idea. You can spawn 4 players. In different locations and have them run into each other at various points of the map.
So it's like 4 players playing a single player game that affect each other at various points.
For example. Player 1 moves forward through his map and reaches a particular trigger or button. This opens or closes a particular route for player 2. Player 2 is then forced to intersect with player 3's map, or pass over the top of it etc..
at the end of the map the team meet up in the middle for a nice big finale battle.
Just a thought!
For Mappers: Forcing the game to spawn particular marines as bots
Assigning Bots to Slots automatically
THe HUD Mod
plaYer2k's Better HUD mod allows the user to fire off specific config commands to the console before the map is loaded. This is really helpful as it allows us to modify the playing experience for each map we want to play in Alien Swarm SP.
In the folder \Steam\steamapps\sourcemods\alienswarmsp\cfg\configloader
You'll find a .cfg file with the name of each of the official maps.
In order for the mod to recognise the config loader .cfg file it must have exactly the same file name as the map it is designed for and simply change the file extension to ".cfg".
So for example the map name for the first official campaign map is asi-jac1-landingbay_01.bsp therefore the map specific config file must be named asi-jac1-landingbay_01.cfg file for it to be recognised and run before that map begins.
Assigning bots
Some mappers out there may want to control which marine characters are spawned for a specific mission. This could be for a variety of reasons but this is generally because the mapper had a specific experience in mind for the gamer.
Using the following commands and placing them into the map specific config file will allow the user to assign bots to team slots and launch the mission. This will effectively skip over the team roster screen.
Here's a single command assigning a bot.
cl_selectm 0 -1
Let's break this down a bit so we can understand what's going on:
cl_selectm
This is a console command that instructs the game to assign a specific marine to a team slot.
0
The 0 that appears after the cl_selectm is the identifying number for the marine character we want to assign.
-1
The -1 is the slot we want to assign them to. Slots range from 0 to 3.
0 is the first slot and 3 is the fourth.
Using -1 here basically tells the game to assign this marine to the next available slot.
Here's a full list of the identifiers for each marine.
Sarge - 0
Wildcat - 1
Faith - 2
Crash - 3
Jaeger - 4
Wolfe - 5
Bastille - 6
Vegas - 7
So when we put it all together, an example of a map config file that assigns bots to each available slot and then jumps straight into the map would be...
cl_selectm 0 -1
cl_selectm 1 -1
cl_selectm 2 -1
cl_selectm 3 -1
cl_start
Here we're assigning Sarge, Wildcat, Faith and Crash to all available slots (including the player slot, slot 0).
The cl_start essentially automatically clicks on the "Start Mission" button and launches the map.
The end result of this is that the player selects the map they want to play and clicks on the "Create Game" button, the map loads and launches straight into the map with Sarge, Wildcat, Faith and Crash all spawned.
If you have any questions on this please e-mail aazell1@gmail.com
THe HUD Mod
plaYer2k's Better HUD mod allows the user to fire off specific config commands to the console before the map is loaded. This is really helpful as it allows us to modify the playing experience for each map we want to play in Alien Swarm SP.
In the folder \Steam\steamapps\sourcemods\alienswarmsp\cfg\configloader
You'll find a .cfg file with the name of each of the official maps.
In order for the mod to recognise the config loader .cfg file it must have exactly the same file name as the map it is designed for and simply change the file extension to ".cfg".
So for example the map name for the first official campaign map is asi-jac1-landingbay_01.bsp therefore the map specific config file must be named asi-jac1-landingbay_01.cfg file for it to be recognised and run before that map begins.
Assigning bots
Some mappers out there may want to control which marine characters are spawned for a specific mission. This could be for a variety of reasons but this is generally because the mapper had a specific experience in mind for the gamer.
Using the following commands and placing them into the map specific config file will allow the user to assign bots to team slots and launch the mission. This will effectively skip over the team roster screen.
Here's a single command assigning a bot.
cl_selectm 0 -1
Let's break this down a bit so we can understand what's going on:
cl_selectm
This is a console command that instructs the game to assign a specific marine to a team slot.
0
The 0 that appears after the cl_selectm is the identifying number for the marine character we want to assign.
-1
The -1 is the slot we want to assign them to. Slots range from 0 to 3.
0 is the first slot and 3 is the fourth.
Using -1 here basically tells the game to assign this marine to the next available slot.
Here's a full list of the identifiers for each marine.
Sarge - 0
Wildcat - 1
Faith - 2
Crash - 3
Jaeger - 4
Wolfe - 5
Bastille - 6
Vegas - 7
So when we put it all together, an example of a map config file that assigns bots to each available slot and then jumps straight into the map would be...
cl_selectm 0 -1
cl_selectm 1 -1
cl_selectm 2 -1
cl_selectm 3 -1
cl_start
Here we're assigning Sarge, Wildcat, Faith and Crash to all available slots (including the player slot, slot 0).
The cl_start essentially automatically clicks on the "Start Mission" button and launches the map.
The end result of this is that the player selects the map they want to play and clicks on the "Create Game" button, the map loads and launches straight into the map with Sarge, Wildcat, Faith and Crash all spawned.
If you have any questions on this please e-mail aazell1@gmail.com
Welcome To Alien Swarm Single Player Mod
I see the future of Alien Swarm (AS) as being a single player game.
The problem with so many multiplayer based games is they require an active gaming community to survive.
As we are being so often reminded at the moment (Feb 2011), people are moving on from Alien Swarm and making silly comments about how its a complete failure. This isn't true of course but I do feel that this games reliance on multiplayer co-op will be its major undoing.
There is a huge section of the gaming community that prefer single player games to multiplayer (yes even and sometimes especially co-op play). Additionally most folks who enjoy a multiplayer session enjoy the Single Player experience.
Bearing in mind that Alien Swarm is a FREE game and available to everyone online, by creating single player maps we're providing free (hopefully high quality) content, that can be played and enjoyed immediately. That's a pretty darn attractive prospect to most players.
As a result I decided to focus on single player mapping. Unfortunatly, AS shipped without many of the SP features enabled. It's all there, it's just not switched on by default. Alien Swarm SP aims to address those issues.
I've based this mod on plaYer2k's Hud Mod and he was kind enough to add in some additional features for me.
Current Features:
- configurable automatic team selection allowing mapper to assign team spots for each map and force player to spawn in a specific marine (skips team roster screen and boots straight to map)
- all official maps and addons available to play in single player mode, through the Offline Practice option in the menu.
- can spawn bots elsewhere in map and bring them into and out of play when you wish (to be used as power-ups etc...)
- Weapon strip allowing more half-life style weapon discovery
- instant health and ammo pick-ups
All these element are optional and can be configured per map you create.
The problem with so many multiplayer based games is they require an active gaming community to survive.
As we are being so often reminded at the moment (Feb 2011), people are moving on from Alien Swarm and making silly comments about how its a complete failure. This isn't true of course but I do feel that this games reliance on multiplayer co-op will be its major undoing.
There is a huge section of the gaming community that prefer single player games to multiplayer (yes even and sometimes especially co-op play). Additionally most folks who enjoy a multiplayer session enjoy the Single Player experience.
Bearing in mind that Alien Swarm is a FREE game and available to everyone online, by creating single player maps we're providing free (hopefully high quality) content, that can be played and enjoyed immediately. That's a pretty darn attractive prospect to most players.
As a result I decided to focus on single player mapping. Unfortunatly, AS shipped without many of the SP features enabled. It's all there, it's just not switched on by default. Alien Swarm SP aims to address those issues.
I've based this mod on plaYer2k's Hud Mod and he was kind enough to add in some additional features for me.
Current Features:
- configurable automatic team selection allowing mapper to assign team spots for each map and force player to spawn in a specific marine (skips team roster screen and boots straight to map)
- all official maps and addons available to play in single player mode, through the Offline Practice option in the menu.
- can spawn bots elsewhere in map and bring them into and out of play when you wish (to be used as power-ups etc...)
- Weapon strip allowing more half-life style weapon discovery
- instant health and ammo pick-ups
All these element are optional and can be configured per map you create.
Subscribe to:
Posts (Atom)