[Coding.Tips++] // Equally Sized Random Piles

Alright let’s start with some coding tips and tricks. This might not be rocket science, but i find it really interesting and useful.

 

:: The Challenge

A while ago i had to split a number into x-random piles. The sum of all piles must be the number and each pile must have the same chance of getting the same size.

 

It’s a bit hard for me to explain it but let me give you an example:

Imagine you have a piece of paper (a long strip). You want to cut it into 5 pieces where every piece has the same chance of being somewhere between 1 and maxLength – 1 cm long.

For example if your piece of paper is 20 cm long and you need 5 pieces, you don’t just want to make a cut every 1-4 cm or something and use the rest for your last number. Then you might end up with something like 3, 4, 2, 4, 7. The last piece will always have a higher chance to be bigger than every other piece.

 

So we need to find a system that gives every piece the same chance of being as long as it’s other paper friends!

 

If you think about it for a while, this is not too easy, unless you already know about the method (or a similar one) i am going to talk about.

 

:: The Scenario

So let’s imagine your number is 30 and you need to create 5 random “equal” piles out of it.

For example your end result could look like 4, 6, 3, 7, 10. All those numbers would add up to 30 in the end. But how do you get them? Well it’s not too hard actually!

 

NOTE: All examples are in sort-of pseudo code.

So let’s define some things first:

 

We know that our max value is 30 and that we need 5 piles in the end. The next step would be to iterate amountOfPiles – 1 times through our maxValue and pick random numbers. However there are 2 conditions:

  1. Pick a random number between 1 and maxValue -1
  2. You can not have the same random number twice

 

Now we will have 4 numbers that are somewhere between 1 and 29 each. Of course this is not what we want, cause adding up all those numbers could be way over 30!

Instead imagine our max number is a 30 cm piece of paper and the 4 random numbers we just created are cuts. This will leave you with what? Exactly! 5 pieces of paper! Now that sounds more like what we want.

 

All we have to do now is figure out how long each paper piece is, which we can achieve by doing following:

  1. Add the 0 and maxValue back to your randomNumbers
  2. Sort your randomNumbers ascending 
  3. Get the difference between each following randomNumber and you will have your 5 piles!

 

This may be a long bit of code but it garantees you that every pile you get has an equal chance of size.

Hope this wasn’t too confusing and you actually learned from it! :)

 

Creep you guys later <3

SeriousCity – Artstyle and Progress

Creepings everyone!

Like i mentioned earlier, i started working on a new game project call “SeriousCity”, which is just the prototype name.

 

Pre-Story

I played a lot of Anno 2070 and SimCity 5 (grrrr…) in the last few weeks which sort of triggered the desire of working on something like that.

Anno is not a very popular series outside of Germany. When i was little i played a lOT of Anno 1602 with my younger brother and cousin. It was an amazing time and lots of fun in a local network game. They released quite a few sequels to it, 1503, 1701, 1404 and now 2070. The last two ones are actually quite different compared to the first few, but in a good way!

 

Re-lighting my flame of passion for the Anno series, i decided to work on my own game.

Obviously a simulation/strategy game like SimCity/Anno is a HUGE project, no doubt. But my goal is not to make something that is as big and finish it. For me it’s more about working on the different aspects of those games.

Splitting up Anno into smaller pieces gives you a better picture of what to work on. You end up with AI, road creations, different buildings and their task, UI, agents that fulfill tasks, etc. Lot of those “smaller” components are very interesting to me, which is why i want to work on something like that.

 

For me personally, making a game is very similar to playing a game. It’s fun, it’s stressful, it’s rewarding. It’s rewarding to spent hours and hours in Anno, figuring out how the game works and finally ending up with your own huge capital city. Same goes for spending hours on trying to figure out how to make your city game and finally ending up with a system that works!

I rarely finish games – wether i play one or make one. But i am okay with that, the experience i gain is all that matters to me :)

 

The Process

So far i spent a lot of time trying to figure out what style i want to go with. Now this might not be a good thing, but it’s a fun. I went through 3 styles so far – a very blocky minecraft style, a torchlight handdrawn textures style and finally, a paper-look style. The later one is the one i decided on going with, for now! I kept the blocky minecraft style for the terrain and tried to make it look like it’s paper, by randomizing edges to break straight lines. The buildings and environment are very simple in color and shape.

 

I’m really happy with the latest style and i think it’s somewhat unique!

However, i recently added the wood cutter building to the game and used the same colors i used for the houses. It’s somewhat hard to visually identify the buildings that way. But when i compare it to some other games like Anno, etc, the visual of a building does not necessarily identify them. I often still have to click/hover on it to see what exactly it is.

I am not an artist but i will try out some different color schemes for different buildings later on.

 

Features so far

I admit, you can not do a lot in the game yet. However i’m quite happy with what i’ve got!

  • Create randomized Terrain
  • Create roads by creating a mesh at runtime and connect them properly
  • Place buildings on a grid based world
  • Day/Night cycle
  • Create random trees
  • Destroy roads, trees and houses

 

But i will go into more details later on.

 

One part that i really enjoyed when working on this game is optimization!

I didn’t care much about performance when working on my modules. But once it was working and in place, it really bothered me how slow some things were. Creating/deleting roads could take up to 1-2 seconds depending on how large they are, now it’s <10ms! There are quite a few places that i improved and i can talk about those in details if someone is interested.

 

But enough talking, this post is really long already and i will post more once i make some progress on it!

 

Hope you guys enjoy and i’ll creep you next time <3

Using a CONTINUE on my blog!

Creepings everyone!

That’s right, i’ve decided to bring this poor little lonely website back to life.

Mostly because i want to post more game dev related things as i started working on my own private projects again and maybe it will help other people as well :)

 

So before i start talking about details, let me give you a summary of what is going on at the moment:

  • I’m still a full time game programmer at the same company (yay for having a job!)
  • I started working on my own game again which is called “SeriousCity” for now
  • I’m still terrible at doing Let’s Plays so i started streaming more instead :P
  • I will participate in the next Ludum Dare 26 tomorrow!

 

I will split most of those topics into their own little posts, just to keep it a bit more organized and not spam my frontpage with the longest post ever.

So if you are interested, check back in a while to get some updates! :)

 

Thanks for reading and i’ll creep you guys later <3

SeriousCreeper’s Creeperthon – Creepintine Edition!

That’s right! Round #2 of our Creeperthon is starting very soon!

 

Trailer

 

About

Last year during Halloween, some of us came together, played horror games and livestreamed it for you guys, trying to raise money for the Child’s Play Charity!

This year? We will do it a little bit different. How about we all not just work, but also PLAY together!

So what can you expect? We will play tons of different multiplayer games and you guys can join us!

Not only that but you can also use our new punishment system to embarrass some of us for a good cause!

 

 

What is  Child’s Play?

Child’s Play is a charity that helps raising money for children all over the world by playing video games!

This is a fantastic charity and idea and they raised a lot of money in the past. What’s better than helping kids by simply playing video games?

Let’s share the joy of video games!

 

 

When and Where?

February 16th from 12pm to 12am PST!

We will go live on www.twitch.tv/creeperthon so make sure to follow us there so you’ll get notified once we go live!

Don’t want to follow us on twitch? How about Twitter? Just go to www.twitter.com/creeperthon and you’ll know what’s going on! :)

 

 

“How can i help you guys other than donating money to Child’s Play?”

Don’t worry! No one is obligated to donate anything of course. If you just wanna come over, watch us or play with us, feel free to do so!

But if you feel like helping out somehow, sharing this website or the trailer with your friends and family would help us out a lot! Spread the word, let people know about it and let’s work on this goal together!

 

Hope we will see you guys there!

A successful Creeperween #1!

Finally recovered from Creeperween, i just wanna give you guys a small update about how things went.

 

We didn’t get as many viewers as we’d hoped for, but it was still a great success for us.

We raised $81 USD in total! So that’s a really good thing. Of course we would have hoped for more, but hey every single bit counts and i’m happy to see how generous some people are :)

 

But also a big thanks to everyone who mentioned us, retweeted and just came by to watch us play or say hello. We had a blast and it was great to have you guys with us! So thanks again guys <3

 

I have to be honest, a lot of things didn’t work out the way i planned. Mostly due to not having enough of time to plan things right.

We “wasted” a lot of time on decoration (which in my opinion turned out to be great, some videos will follow!), and not enough time on technical stuff. We also should have organized things a lot more.

 

But hey, it was the first event, we raised money and we can learn from our mistakes to make it a lot better next time!

 

And “next time” might be soon actually. We already started planning “SeriousCreeper’s Seriously Not So Creepy Creepmas!” (title wip).

We still have tons of games to give away from Creeperween which makes it a lot cheaper on our side.

I will announce once we decide which day we want to host this event, but the good thing is that this time, we will have a lot more time to plan and organize everything!

 

So expect some Behind the Scene, Making Of and Best Of videos soon!

 

Thanks again and “BEES?”!

Big Event: SeriousCreeper’s Creepy Creeperween Live Stream

That’s quite a mouthful but hey, it’s gonna happen and i’m really excited!

 

Trailerhttps://www.youtube.com/watch?v=49VvMQiVW-o

 

 

“What is this SCCCLS Event you ask?”

Well, last year i wanted to have a big Halloween-ish live stream event but i didn’t have enough time to plan it.

This year, even though it’s a bit late again, it will happen!

I will meet up with some friends at my apartment, make it look a bit halloween-ish, have some food, drinks and live stream horror games, so everyone can see our “i screamed like a little girl” faces!

It’s gonna be fantastic!

 

Now since Halloween is on a Wednesday and not everyone of us can afford to take a day off, we will do it on a weekend. Sadly the weekend BEFORE Halloween won’t work for some people either, so we settled for the next one.

I know it’s not quite halloween anymore at that point, but who cares. This is not a halloween event anymore, this is Creeperween!

 

“When is it?”

The event will start at November 3rd at 6pm PST and goes on till at least November 4th 6am PST!

From 6pm to 9pm we will play some board game and stream it as well. At 9pm we will start with the horror games :)

 

“How will i know when you start streaming?”

To make sure you don’t miss any second of this glorious day, you can follow me on following pages:

I will post a message on every account the moment i go live!

 

“What can i expect?” 

  • 5-7 amazing people in one (hopefully creepy looking) apartment
  • One person will be streaming horror games with a face cam so you can enjoy their stupid expressions!
  • I will have a TV infront of my couch that displays what you guys see on the live stream, mainly the game, the face cam, the live stream chat and hopefully a 2nd camera for the couch view
  • That way people who are not playing at the moment can still watch the expression and live stream
  • We will have 1-2 microphones setup so you can talk with anyone in the room and hear their comments
  • This event will contain some alcohol so you might see some hilarious stuff that night :P

 

“Are there gonna be any give aways?”

Oh you greedy bastard! Of course there will be! :P

So yeah i’m trying to get as many game keys as possible to give away to you awesome guys, watching us dying of fear. At this point i don’t know exactly what games we can give away, as we have a very limited budget, but we will arrange something, so keep checking for updates soon!

By the way, if you feel generous and have some keys to give away, please get in contact with me on twitter.com/Serious_Creeper <3

 

“What games will you be playing?”

Now we have quite a long list of POSSIBLE games we want to play. This is not final, and we might not cover every game. Some games are pretty hard to stream, so we still need to test it out a bit, but to give you a rough idea, here is our current list:

  • Amnesia
  • Slender
  • Der Unbekannte Krieg
  • Lone Survivor
  • Silent Hill 2
  • Siren Blood Curse
  • Clock Tower 0 + 1
  • Fatal Frame
  • System Shock 2
  • SCP
  • F.3.A.R.

If you think we definitely have to play a specific game, let me know!

 

“Anything else?”

Yes! Sort of. I am trying to set this even tup as a Child’s Play Charity event. That way, if people enjoy what we are doing, they can donate to Child’s Play (100% of the money goes to them, we don’t take anything from it!) to help out kids who really need it! :)

I think Child’s Play is a fantastic idea and it i see a lot of people supporting that foundation, so please help out if you can!

It also gives us the opportunity to do crazy things like “If we reach 500 Dollars, Person A will eat a jar of poisonous spiders!”… well, something like that, just not as deadly :P

If you have suggestions, let me know!

 

 

“That sounds amazing, is there anything i can do to help?”

Now if you really think about helping us out, that would be amazing, thanks so much! There are many things you can do actually.

Probably the biggest help would be to share this information with as many people as you know (but please don’t spam anyone!). The more people know about this, the more viewers we’ll get and the more we can raise for Child’s Play!

If you feel SUPER generous and you have some spare game keys you could donate for the give aways, please get in contact with me! I might love you forever <3

 

 

So hopefully i will see lots of you guys there.

I will release a trailer soon so make sure to look out for that!
Creep you guys later <3

Karma is a bitch, but sometimes a funny one

So let me tell you what just happened.
We had a meeting for a new potential office tour. Afterwards some of us walked back together and grabbed a Starbucks on the way (which I really needed, woke up at 6:30am, crazy!!).

 

A couple of minutes we arrived at the office. While we were walking up the stairs, we were shit chatting about how to improve our new created time machine (ok not really, but it spices up this story).

 

Then it happened – a co-worker in front of me took a sip and tripped, looking like an idiot, which triggered the “schadenfreude”* signals in my brain and I started to laugh. Now, it seems like my brain can only do one thing at a time – walk or laugh. Since it went with the second option, my legs stopped being smart and I tripped as well, spilling coffee all over my shirt.
Of course it’s not any kind of shirt, nope, it’s a VERY white one, or at least it was before that incident.
Despite the fact I failed, I laughed about it, a lot, maybe more than I should have, but it was glorious.

 

So yeah, karma is a bitch, but sometimes it’s really funny :)

 

What karma situations have you been in?

 

Creep you next time, take care!

 

*the joy of someone’s misfortune

Some things are too long for Twitter

First of all, welcome to my new blog!

I’ve started many blogs in my life and every time they failed to exist longer than a month, except for my game dev blog, which died due to moving to a new server and loosing my backup files. But that’s a different story.

 

I think the reason why my (personal) blogs never last, is because i tried to stick to a specific topic. So this time i will just writer whatever and whenever i want, that simple.

 

So as the title says, sometimes i have things to say that would be way too long for Twitter and i really don’t want to spam anyone with my stuff. So i thought “Hey SC, a new blog might be a brilliant idea!”.

 

Now if you don’t know me, i am german, which means english is not my mother tongue. In fact, before i met my Canadian girlfriend 9 years ago, my english marks in school ranged from D- to E… yep.

So if you find horrible typos or grammar mistakes, feel free to point them out, i’m always happy to see my mistakes and correct them!

 

Anyway, what can you expect on this blog? Well, just about anything that goes through my mind. In fact, there are several topic i’d like to talk about in the next few hours/days/weeks. I believe some of those things might be interesting for other people and they could lead to very interesting conversations. But we will see :)

 

But for now this should be it! You can always follow me on this, per RSS or whatever else is out there. I’m not too familiar with this whole blog following thing but i’m sure you guys are.

 

Thanks for reading so far and i’ll see creep you soon!