Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (495)
Games in Android Showcase (114)
games submitted by our members
Games in WIP (563)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  [Alpha] Cantrips and Cooldowns  (Read 3840 times)
0 Members and 1 Guest are viewing this topic.
Offline dkramer

Junior Member


Medals: 5
Projects: 1



« Posted 2014-01-01 07:48:18 »

Hello everyone! I have a little battle arena game to show you guys:


<a href="http://www.youtube.com/v/s3-Jxb3xphE?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/s3-Jxb3xphE?version=3&amp;hl=en_US&amp;start=</a>

Download links can be found here Grin: http://cantripsandcooldowns.wordpress.com/play-now/

Below is a tech write-up that I posted to the gamedev subreddit:

In 11 months and 500 cups of coffee I was able to take this (http://www.youtube.com/watch?v=iaxQhRuu9rc) single-player world and graphics demo of mine and turn it into something like what you see up above. It's not the prettiest nor the most difficult-to-create game, but I created something that I find to be fun to play, and I learned a whole lot along the way. Also, it has just reached what I consider to be alpha, so there's still a lot of content to be added. This'll be a little post detailing the pitfalls I ran into, the little stories along the way, and why I used the stuff that I did.

Programming Language

This was an easy choice for me: Java. The Computer Science classes that I took when I was in highschool 2-3 years back were the first nudge in this direction, but I didn't end up learning a whole lot from them. My previous programming experience lies mainly in Minecraft plugin development. I learned a good bit about Java while creating these plugins, so it was only a matter of time before I branched out and did my own thing. Since I didn't know any other language quite as well, Java it was.

Graphics

I set out on Google to find a decent 2D library, because I sure as hell wasn't going to do 3D with the lack of knowledge that I possessed. I stumbled upon Slick2D (http://slick.ninjacave.com/) (a library wrapped around lwjgl (http://lwjgl.org/)), downloaded it, and stuck with it. It wasn't long before I needed UI components, and Slick wasn't much of a help in that department. It seemed that a lot of the UI libraries that I came across needed XML files to function or didn't fit what I needed, and I was stubborn about not changing my ways for them, so I set forth and created my own UI code integrated into Slick's state system.

But what of the game's aesthetic? I eventually decided on spritesheet-based ground and wall tiles and a polygonish/vectorish style for everything else. And I knew that I wanted it to be pretty colorful. Since I can't create realistic art and since polygon-drawing code isn't out of reach of my abilities, that became the plan.

RAM usage was ridiculous after I implemented the color-changing background. It wasn't too high, but it fluctuated very wildly very quickly. Through the use of a profiler and digging through Slick's code, it became apparent that Slick creates a new Color object (float red, float green, float blue, float alpha) every time you call the setColor() method. Every. Time. You know, this wouldn't have been a problem if I didn't set the color thousands of times a second to render the background. At least the fix was easy: have two static Color objects, and whenever the setColor method is called, set the floats of one of the colors, then on the next call, toggle a boolean to set the floats of the other. And back and forth and back and forth. Done and done.

On the topic of the background, I could spend a bit of time explaining how it functions. All of the little background squares are just that, opengl batched and drawn square quads. Their three color values, red/green/blue, are each determined by their own two-octave perlin noise generator. A forth two-octave generator adds some random dark spots. The red is slowly shifted down, the blue left, and the green right. The 3D looking "height" of the squares is determined by adding the red+green+blue values, and since the colors shift in different directions, a wavelike effect (http://www.youtube.com/watch?v=Gdu3b5vjTpA) is created. The same generators are used to slightly alter the color of ground tiles. As with tiles and walls, this is a pseudo 3D effect.

Inkscape (http://www.inkscape.org/en/) and Paint.NET (http://www.getpaint.net/) were my very best friends.

Networking

Kryonet (https://github.com/EsotericSoftware/kryonet) became my library of choice, and there's not too much to say about it. It's a really nice little library that handles the dirty packet bits and bytes for you. You can register classes as packet classes, call some methods, and send objects of these classes over the net.

Player (and some spell) positions, rotations, and cooldowns are sent as UDP packets, and everything else is sent by TCP.

For months I had an issue where the client wouldn't receive UDP packets for about 20 seconds after they received ~8000-9000 of them, and this was nearly always replicatable. I had no luck trying to find errors in kryonet though, so I had the client tell the server "yo, I haven't had a position packet in a while, give me them in TCP", and this worked, but I hated doing this for obvious reasons. I updated the version of lwjgl bundled with the game the other day, and since then, I haven't had this issue. I don't know if that's the reason or if something else is, so here's to hoping it doesn't come back!

Physics

I learned the ins and outs of JBox2D (http://www.jbox2d.org/) to get physics up and running. To make sure people walk at the speed they're supposed to even with all these forces acting upon them by spells, I created a Pseudo-Force system. Every update, the player's velocity is zeroed by putting a force on him in the opposite direction of his current velocity. Then, I apply the movement speed velocity. Then, the pseudo-forces are added. Then the pseudo velocity vectors themselves are lowered to get ready for the next update. It feels kinda hacky, but it works really well and easily allows for things like removing enemy forces on you.

Sound

All of my music came from Lucky Lion Studios (http://luckylionstudios.com/). The tracks average about a minute to a minute in a half in length, so I play each one twice before moving on to the next. The main menu has its own theme, battling has faster music, and the map editor features more chill music.

I created the rest of the sound effects by making weird noises into a microphone and editing them in Audacity (http://audacity.sourceforge.net/).

Inspiration

Warlock, a custom map for Warcraft III (http://www.youtube.com/watch?v=v2uOGQegj2c), was the biggest inspiration of mine. It was a battle arena game that didn't have cooldowns or creeps or lanes or farming or anything, and it proved to be a big hit at LAN parties. I wanted to create something that is fun to play with friends, and the idea of a physics-based battle arena game stuck with me.

Thanks!

Thank you for reading! I don't expect anyone to read this far, but it felt nice getting my story out there. Happy new year!
Offline Troubleshoots

JGO Knight


Medals: 36
Exp: 7-9 months


Damn maths.


« Reply #1 - Posted 2014-01-01 12:14:34 »

Looks really nice, great job. I love the art. Very impressive. Cheesy

Why are all OpenGL tutorials written in Brainf**k?
Offline dkramer

Junior Member


Medals: 5
Projects: 1



« Reply #2 - Posted 2014-01-01 19:38:10 »

Looks really nice, great job. I love the art. Very impressive. Cheesy
Thank you thank you  Grin Grin
It's great to hear that people like the art, because I feel that that is my weak point.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Xyle
« Reply #3 - Posted 2014-01-02 00:38:29 »

Wow!

I was happy with just reading the account on making the game. Then I watched the video, and was amazed by the quality of graphics!

Outstanding job! I will be grabbing this little tidbit this weekend. Its a work night, so beddy time is too early. Smiley

Thanks for sharing the account too, thats always just as fun as playing the games!

Life is just a game, learn to play!
------------------------------------------
╬-YellzBellz Games!-╬ Cheesy
Offline dkramer

Junior Member


Medals: 5
Projects: 1



« Reply #4 - Posted 2014-01-02 05:21:02 »

Wow!

I was happy with just reading the account on making the game. Then I watched the video, and was amazed by the quality of graphics!

Outstanding job! I will be grabbing this little tidbit this weekend. Its a work night, so beddy time is too early. Smiley

Thanks for sharing the account too, thats always just as fun as playing the games!

Ooooh man thank you very much! I'm glad you enjoy it Grin!
If you want a person to play with, I'm your guy!
Offline Gjallar

JGO Coder


Medals: 13
Projects: 1


Follower of Nurgle


« Reply #5 - Posted 2014-01-02 08:43:55 »

Wow!

I just tried this and must say that it's very polished. The thought of trying to recreate the warlock map from wc3
already crossed my mind a couple of times. I'm glad someone actually went and did it  Cheesy

Offline dkramer

Junior Member


Medals: 5
Projects: 1



« Reply #6 - Posted 2014-01-02 09:52:33 »

Wow!

I just tried this and must say that it's very polished. The thought of trying to recreate the warlock map from wc3
already crossed my mind a couple of times. I'm glad someone actually went and did it  Cheesy
Thanksa Cheesy
I knew that I wanted to make a multiplayer game, then I knew that I wanted to make one that's fun in a LAN party because we have those a bunch in my friend group. Warlock seemed a very good fit because I felt that I could put the base idea to use and expand upon it with my own ideas, so it's been fun!
Offline SwampChicken
« Reply #7 - Posted 2014-01-03 09:01:47 »

I haven't looked at the game or watched the video but I sure as hell enjoyed reading your write-up about your experiences on building the game.
Offline dkramer

Junior Member


Medals: 5
Projects: 1



« Reply #8 - Posted 2014-01-03 16:47:23 »

I haven't looked at the game or watched the video but I sure as hell enjoyed reading your write-up about your experiences on building the game.
Glad you read it! Especially since it's quite long. I think that developers' stories really help in figuring out "why is it like that?" and showing that we all have some problems along the way.
Offline Xyle
« Reply #9 - Posted 2014-01-05 06:58:04 »

Very nice job!

The game is well polished with some really good looking artwork and I can see where it can get pretty addictive. An awesome little multiplayer game.

Big Kuddos to you for implementing a successful multiplayer. Just achieving that is worth a ton of credit. In the ten years I've been bleeding my fingertips, I made 1 multiplayer game and it was a somma bitch to get right. I absolutely love the background too. You should release a screen saver for that!

One thing you may want to include is a help area that explains the GUI, all the numbers, why you get money for hitting the blue blocks, how to use purchased items, info on the items and spells, etc.

The downside is having to pay to really test it out. You can maybe look at a free version that allows only for 1 map, limited players, limited spells or something like that. I realize $5 for alpha really isn't that much. But for someone like me, who tries to stay away from playing because I'm trying to make games, I don't get the real experience of the game. Just a recommendation though!

Awesome, awesome job here! And again thanks for the write up on this!!

Life is just a game, learn to play!
------------------------------------------
╬-YellzBellz Games!-╬ Cheesy
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline dkramer

Junior Member


Medals: 5
Projects: 1



« Reply #10 - Posted 2014-01-05 17:42:34 »

Very nice job!

The game is well polished with some really good looking artwork and I can see where it can get pretty addictive. An awesome little multiplayer game.

Big Kuddos to you for implementing a successful multiplayer. Just achieving that is worth a ton of credit. In the ten years I've been bleeding my fingertips, I made 1 multiplayer game and it was a somma bitch to get right. I absolutely love the background too. You should release a screen saver for that!

One thing you may want to include is a help area that explains the GUI, all the numbers, why you get money for hitting the blue blocks, how to use purchased items, info on the items and spells, etc.

The downside is having to pay to really test it out. You can maybe look at a free version that allows only for 1 map, limited players, limited spells or something like that. I realize $5 for alpha really isn't that much. But for someone like me, who tries to stay away from playing because I'm trying to make games, I don't get the real experience of the game. Just a recommendation though!

Awesome, awesome job here! And again thanks for the write up on this!!

Thank you Grin!
I've no idea how to make an animated screensaver, but here are some pictures if you'd like a wallpaper!
http://imgur.com/a/mvqka#0, http://i.imgur.com/Lbsqr3C.png, http://i.imgur.com/JPBPKmT.png, http://i.imgur.com/XuHaprx.png, http://i.imgur.com/zpf0S9k.png, http://i.imgur.com/LMAJAOQ.png, http://i.imgur.com/bOt98Fy.png, http://i.imgur.com/1OTFeYc.png

I agree with you on needing a "Help" section to explain some stuff! This will definitely be in once full release comes around.

The "Offline" mode still has all the same gameplay and a couple maps. It just doesn't have the map editor or server list, but you can play with people that are in offline mode. No one's hosting servers in online mode right now anyway Tongue. The $5 goes toward keeping the master server alive so I can distribute updates and handle logins and online-mode servers.

Thanks again for the feedback! I'm gonna get back to creating a new spell, mweheh
Offline ziddia

Junior Newbie


Medals: 1



« Reply #11 - Posted 2014-01-13 01:44:05 »

Definitely looks like fun to play, although I haven't had much of a chance to mess around with it, considering the lack of servers.
Offline dkramer

Junior Member


Medals: 5
Projects: 1



« Reply #12 - Posted 2014-01-13 03:54:30 »

Definitely looks like fun to play, although I haven't had much of a chance to mess around with it, considering the lack of servers.
Yeah, sorry about that! Getting a consistent amount of people playing is very tough for a game like this because no one knows me. I gotta be a marketer man for beta/release. I can play with you if you'd like!
Offline ziddia

Junior Newbie


Medals: 1



« Reply #13 - Posted 2014-01-13 22:08:38 »

Yeah, sorry about that! Getting a consistent amount of people playing is very tough for a game like this because no one knows me. I gotta be a marketer man for beta/release. I can play with you if you'd like!

That'd be cool, if there's ever a time when you're available I'd love to give it a go.
Offline dkramer

Junior Member


Medals: 5
Projects: 1



« Reply #14 - Posted 2014-01-14 14:51:22 »

Yeah, sorry about that! Getting a consistent amount of people playing is very tough for a game like this because no one knows me. I gotta be a marketer man for beta/release. I can play with you if you'd like!

That'd be cool, if there's ever a time when you're available I'd love to give it a go.

Cool beans Grin
I should be available tonight at about 7 US central time!
Offline dkramer

Junior Member


Medals: 5
Projects: 1



« Reply #15 - Posted 2014-01-22 17:26:56 »

My bots will beat up your bots: <a href="http://www.youtube.com/v/6vtai34m4cY?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/6vtai34m4cY?version=3&amp;hl=en_US&amp;start=</a>
Offline Gibbo3771
« Reply #16 - Posted 2014-01-22 18:06:16 »

Watched the first 10 seconds of the top video, this looks good and has a hella lot of potential.

If you took this further, you could essentially make something like a 5v5 match system. If you add more content like weapons + class types (tank, healer, damage) you could easily make a little guildwars style RPG imo.

This might not be what you want but it is defo possible to go there from here imo.

"This code works flawlessly first time and exactly how I wanted it"
Said no programmer ever
Offline dkramer

Junior Member


Medals: 5
Projects: 1



« Reply #17 - Posted 2014-01-23 03:50:28 »

Thank you! Yeah, I'm definitely going to add more content in items/spells! It's been slow going in this department because of all the work I've been putting into bots, and because of school starting back up for me. I've been getting nice gamemode ideas from these bots (especially ones that can be played solo because the servers will be empty until the game picks up steam), so tinkering with that has been fun. I'd love to eventually have a matchmaking system, but I'll leave that for when I have other content and an actual player base.
Pages: [1]
  ignore  |  Print  
 
 

 
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!