Over the weekend, I finally got the time to delve into the multiplayer functionalities of the Unreal Engine from chapter 8 of my book. I was happy to discover that the general way of things is kind of similar to Unity's way, where server and client code are shared, but clearer in a way; instead of RPC calls, just add the keyword 'client' or 'server' in the function prototype and you're done, every call to it will be sent over the network.
For the variables it's even simpler; instead of having your network view tracking some component, you can just add the variables you want replicated in the 'replication' block and have them being automatically replicated under some conditions. Things get more complicated from there, but it's overall pretty logical.
It all looks nice and easy, but setting up the multiplayer was a bit of a pain for a first time user. Of course, there was the regular mistake of forgetting to call the parent class' version of functions in the reeimplementation (in this case, PostBeginPlay(), which is a pretty big deal since the server crashes at that point), which is still as frustrating as the first time ("How could I have been so dumb!"). Once that was done, my next 4 hours were dedicated to dig in the Unreal API and find out why my weapon wasn't firing. As it turns out, a function I had copied from the PhysicsGun class was not necessarily meant to be taken in a multiplayer setting, at least not the way I was doing it. Just changing its name (StartFire to ServerStartFire) did the trick.
Of course, after doing all this it looks *only* like what it did when it was single player. Which means there's no video this time. Still, I'm really happy. The biggest achievements are not necessarily the most visible ones.
Unreal Engine: An Independent Study
Thursday, April 18, 2013
Sunday, April 7, 2013
Phun with Physics
Following up on my last post, I played around with the physics gun class. I also figured out how to add actors influenced by physics (KActors, thanks to the example map that helped me figure it out). Not too long after... voilĂ ! I managed to use the physics gun class properly, as the picture here tries to show (but it kinda fails at it, a video would be better).
Now I just have to customize the functionality to have the guns I need... and then I can move on to The Rest!
Box flying thanks to the awesome gun (I used the rocket launcher visuals) |
Now I just have to customize the functionality to have the guns I need... and then I can move on to The Rest!
Thursday, April 4, 2013
After GDC, attacking again!
Last week was crazy. GDC is as much a networking ground as it is an old friend's reunion and party place. That said, now is the time to go back to what makes it all worth it: making games!
After some consideration, I decided to ditch my first pass at a level altogether. A purely vertical level was presenting challenges that I wasn't sure I had the time to address; therefore, I opted for a horizontal disposition, as you can see in the following image.
My goal is to make a small 3D tic tac toe FPS with physics combat elements. Which means, instead of shooting each other in the face, the players will each have a gun each applying a different force on the target (one attractive, one repulsive). The goal for the players is same as in tic-tac-toe, but in order to place a symbol somewhere they will have to use their gun to manipulate it. Of course, you can also hinder the movements of the other player by shooting your gun at him/her, by blocking critical corridors...
To make it all happen, I've started digging around the API to see which classes I can extend and which functions I can use. I've found a physics gun class, which seems like it would be a good starting point.
After some consideration, I decided to ditch my first pass at a level altogether. A purely vertical level was presenting challenges that I wasn't sure I had the time to address; therefore, I opted for a horizontal disposition, as you can see in the following image.
View from above |
My goal is to make a small 3D tic tac toe FPS with physics combat elements. Which means, instead of shooting each other in the face, the players will each have a gun each applying a different force on the target (one attractive, one repulsive). The goal for the players is same as in tic-tac-toe, but in order to place a symbol somewhere they will have to use their gun to manipulate it. Of course, you can also hinder the movements of the other player by shooting your gun at him/her, by blocking critical corridors...
To make it all happen, I've started digging around the API to see which classes I can extend and which functions I can use. I've found a physics gun class, which seems like it would be a good starting point.
Tuesday, March 19, 2013
After the storm
Hey there! Didn't see you in a while. One of my other projects finally caught up to me and I had to enter crunch mode, so I completely neglected this independent study.
It ends today.
I came back to Unreal today with renewed determination and started building what will be the first room of my first game. Pretty exciting to me :) however, since I plan on doing several really similar room, I'm going to try to look into how to copy/paste with BSP surfaces. It might be easy; I couldn't find it.
Here's what the room looks like:
There will be two different geometric shapes in the middle of each room: a sphere, as you can see, and some other shape (still to determine). Those shapes will be changeable depending on the players' actions. Also, the rooms are going to be disposed in a 3x3x3 layout.
Now the game of the day... from what I've said, can you guess which type of game I'm building?
It ends today.
I came back to Unreal today with renewed determination and started building what will be the first room of my first game. Pretty exciting to me :) however, since I plan on doing several really similar room, I'm going to try to look into how to copy/paste with BSP surfaces. It might be easy; I couldn't find it.
Here's what the room looks like:
From the outside |
From the inside |
Now the game of the day... from what I've said, can you guess which type of game I'm building?
Wednesday, February 20, 2013
Level building
In the list of things to learn, here's a pretty good one. Terrains and static meshes are one thing; but how do you build a level?
Introducing the BSP brush! This building brush comes with several preset shapes (primitives like planes, cube, spheres, but also straight stairs, curved stairs...); you just select the different sizes you want (by right-clicking on the shape - that sounds obvious, but I could only figure it out by reading the official doc), and then adding the surface (and since you can add, you can also substract - pretty interesting and offers good creative possibilities).
And that's not it! With this tool, you can also add special volumes: water volumes, physics blocking volumes, but also level streaming volumes, ladder, gravity... Overall a pretty easy to use and very powerful tool.
So far, the only problem I faced when using this tool was the fact that you have to drag the brush around to go where you want your volume/surface to be created. It sounds ok, but when you have a really big volume and you want to align the edges with some other surface, for instance, it gets pretty painful.
After several hours of slow progression, here's a screenshot of my first level with the BSP brush. There are regular surfaces, some with materials on them, a skybox (waaaa) and a water volume with a transparent plane on top featuring an animated water material (so pretty! also kinda inadapted to the scenery I was building but oh well ;)). And some stairs. I like stairs.
Introducing the BSP brush! This building brush comes with several preset shapes (primitives like planes, cube, spheres, but also straight stairs, curved stairs...); you just select the different sizes you want (by right-clicking on the shape - that sounds obvious, but I could only figure it out by reading the official doc), and then adding the surface (and since you can add, you can also substract - pretty interesting and offers good creative possibilities).
And that's not it! With this tool, you can also add special volumes: water volumes, physics blocking volumes, but also level streaming volumes, ladder, gravity... Overall a pretty easy to use and very powerful tool.
So far, the only problem I faced when using this tool was the fact that you have to drag the brush around to go where you want your volume/surface to be created. It sounds ok, but when you have a really big volume and you want to align the edges with some other surface, for instance, it gets pretty painful.
My dreamhouse |
Monday, February 18, 2013
The editor: terrain, textures, meshes
Big undertaking, big problems, big discoveries.
I realized today (silly me) that in order to build a game with unreal engine, I didn't just need to know how to program it. I also need to know how to properly build it, as in, build the map(s) or level(s).
Grave underestimation.
The UDK editor comes with a huge set of features, each of which requires some learning to be able to use. My first challenge was to understand how to create a terrain and shape it. With the help of a couple of videos found on the official website, I managed to create my first terrain, and to even have different textures on it. Small step for mankind, giant leap for me.
Awesome! Now I can create kick-ass maps!
...and, er, what should I have in them? Next challenge please!
I have to admit, my experience in Unity didn't prepare me for dealing with Unreal. It's not that it's hard, it's just that the learning curve is steeper. But once you know what you need to know, everything's perfectly doable. And figuring out by myself (achievement unlocked!) how to add static meshes from a different package into the current map is a proof to show the world that it is kinda intuitive; once you learned one of the tools, the rest of them are used pretty similarly. I even figured out how to paint colors directly on the meshes. Yea, I painted the roof of the citadel into pink.
And now, what's left? Well... All the rest.
I realized today (silly me) that in order to build a game with unreal engine, I didn't just need to know how to program it. I also need to know how to properly build it, as in, build the map(s) or level(s).
Grave underestimation.
The UDK editor comes with a huge set of features, each of which requires some learning to be able to use. My first challenge was to understand how to create a terrain and shape it. With the help of a couple of videos found on the official website, I managed to create my first terrain, and to even have different textures on it. Small step for mankind, giant leap for me.
Awesome! Now I can create kick-ass maps!
...and, er, what should I have in them? Next challenge please!
I have to admit, my experience in Unity didn't prepare me for dealing with Unreal. It's not that it's hard, it's just that the learning curve is steeper. But once you know what you need to know, everything's perfectly doable. And figuring out by myself (achievement unlocked!) how to add static meshes from a different package into the current map is a proof to show the world that it is kinda intuitive; once you learned one of the tools, the rest of them are used pretty similarly. I even figured out how to paint colors directly on the meshes. Yea, I painted the roof of the citadel into pink.
And now, what's left? Well... All the rest.
Monday, February 11, 2013
Where I'm at, visually
Just thought I'd share this. Here's what the book helped me do:
First thing on the to-do list: improve the aiming. Not knowing which way you're facing makes it really hard >_> Second thing, those smaller enemies that go really fast, well, they're really annoying... and sometimes too frequent (right now they have a 25% chance of being spawned). Tweaks to follow.
Subscribe to:
Posts (Atom)