Recent posts by EndlessSporadic on Kongregate

Flag Post

Topic: Game Programming / Using classes in AS3

If you know how to code, I highly suggest you to stop using confusing stuff like the timeline and everything else you can find in the flash GUI in order to code everything in the AS files.

This is why I hate recommending Flash to anybody who isn’t a professional programmer. The timeline adds an unnecessary layer of complexity to the learning process.

 
Flag Post

Topic: Game Programming / League of Legends Hacks, Bots, Cheats & Exploits (working 100%)

I’d like to remind people that these things don’t actually work, they are against Riot’s ToS, and they usually contain viruses.

 
Flag Post

Topic: Game Programming / Looking for life advices.

If you are already familiar with programming in general and you want to focus on game development (NOT software development), the following is my advice. The following should take roughly a year. If you want to half-ass it or you are actually confident enough in your own knowledge you can skip immediately to step 3, though since you made this thread I recommend starting at step 1.

1) Familiarize yourself with component-based programming. OOP is cool and all, but things become extremely ugly when you include multiple subsystems.

2) Make a 2D game in XNA. Yeah, XNA is no longer officially supported, but it still works and you don’t need to finish the game. You only need to be familiar enough with how it works in order to quickly implement what you want. The point here is that you understand the game loop and understand the relationship between multiple objects and how those objects are handled within the application.

3) Remake that game in Unity. This is your introduction to component-based programming using a game engine with C# from XNA. Once you understand how components interact with each other immediately uninstall Unity and go to step 4.

4) Purchase a subscription to Unreal Engine 4 (you can purchase the subscription for $20USD, cancel it, and never have to pay again – you can still publish your game but you will not be able to receive engine updates after 1 month. It’s a real steal). At this point you should be familiar enough with component-based programming to instantly pick up Unreal 4 and use the blueprints to make something interesting.

5) When you become familiar enough with the blueprint system work on rewriting your blueprint data into C++. Reaching this step can take a while. Just take your time with this one.

 
Flag Post

Topic: Game Programming / What is this called?

You are looking for “Flags” or “Tokens”. Flags can either be multiple boolean values or a single integer (also known as “bit flags”). Tokens can be either bools or integers.

Example for Boolean flags:

bool bHasCompletedLevel1 = true;
bool bHasCompletedLevel2 = false;
bool bHasObtainedSword = true;

Example for int flags:

byte MyFlags = 36; // this is the same as 00100100
byte MyCondition = 1 << 5; //this is the same as 00100000
if (MyFlags & MyCondition)
{
//Flag is set!
}

Example for Tokens:

int CoinsCollected = 205;
bool bHasFinishedFirstLevel = true;
byte CurrentLevel = 4;
 
Flag Post

Topic: Game Programming / as3: how do i write this? (part 2)

There are multiple ways to do this. In order of speed and readability (readability trumps speed):

1) Dictionary/hashtable lookup.

2) getDefinitionByName() which, correct me if I’m wrong, uses reflection which is super slow, especially when instantiating multiple objects (f**k you Unity)

3) Switch / if-else statements

 
Flag Post

Topic: Game Programming / Can adding RAM cause driver issues?

I’m no RAM expert – in fact, it is the part of the computer I understand the least. I apologize for providing some false information and thanks to the others for clarifying.

 
Flag Post

Topic: Game Programming / Can adding RAM cause driver issues?

I’m making some assumptions here about your technical knowledge. Take no offense by it if you happen to know this already.


It is possible that you damaged something while adding the RAM. If you didn’t ground yourself properly you may have damaged a part due to static electricity.

Also, was your original 8GB RAM a single channel or dual channel (is it a single 8GB stick or two 4GB sticks)? How about your new RAM? You can’t mix and match sizes, and you need to insert them into the right slots in your mobo. This means that if your original RAM was 2 4GB sticks, you are NOT allowed to add 1 8GB stick. If you have two 8GB sticks, they go in slots 2 and 4 in the motherboard (or 1 and 3), not slots 1 and 2.

It is also possible that you received a defective product. Remove the RAM you added and see whether the computer works as intended.

 
Flag Post

Topic: Game Programming / Where to start?

The shootorials here on Kongregate actually aren’t all that bad.

 
Flag Post

Topic: Game Programming / Does Kongregate allow scriptaccess to my domain?

As far as I know it won’t work because Crossdomain.xml.

 
Flag Post

Topic: Game Programming / Any FREE game making programs

There is no such thing as a good free game engine. You either pay upfront, royalties, or both.

For $20 you can get Unreal Engine 4 (plus 5% of whatever you make over $100,000). You can make pretty decent games using exclusively blueprints (visual coding). You can also add your own C++ code at any time as support methods. They have templates of a lot of games and many complete projects you can look at to see how things are done. It exports to HTML5 as well if you are inclined to upload the game to Kongregate.

 
Flag Post

Topic: Game Programming / Learn How To Create Your First Game Without Any Programming Experience

This is a programming forum. No use on posting a tutorial on how to make a game without programming here. You will only get laughed at.

 
Flag Post

Topic: Game Programming / Boggle Solver Help

Dictionary searches use a data structure called a “Trie”. You can find more information about it here.

 
Flag Post

Topic: Game Programming / Fastest way to compute Square Root? [solved/nvrmnd]

I’ve edited my post, and it seems like you are attempting to do some weird rendering. If that is the case you may want to take a look at the fast inverse square root algorithm and see if you can make it work.

 
Flag Post

Topic: Game Programming / Fastest way to compute Square Root? [solved/nvrmnd]

What are you working on such that you need to optimize the sqrt method instead of looking elsewhere for optimization?

There is “quick but inaccurate” (to around 5%) and “slow but accurate”. The “quick but inaccurate” method is inaccurate because it sacrifices float precision in order to use bit operation. This means if you want to find the square root of 25.3, it will round that to 25 and get you the answer in 2-3 operations.

Take a look at “fast inverse square root”. You will need to take the inverse of it to get your answer and it has an error range of around 3%, but it is quick.


General optimization tricks:

1) If you are multiplying by a whole scalar, add instead. For example, x * 4 should be written as (x+x+x+x). Many compilers will optimize this internally for you, but if they don’t the compiler will need to turn this into addition at runtime taking extra cycles (note that all computer math – ALL MATH – is addition).

2) Use powers of two for your multi-dimensional arrays. In all indices but the first the compiler will attempt to replace operations with bit shifts. This method will sacrifice memory for speed. For example, myArray2014 should be myArray2016.

3) Compilers work better when iterating downwards and they always evaluate the condition first. If you know that your condition will be true at least once, use a do-while loop instead of a for loop and decrement “i” down to 0 instead of incrementing to X-1.

Small tips and tricks like this are all over the internet. sqrt is not something you should go out of your way to optimize unless you are writing your own renderer.

 
Flag Post

Topic: Game Programming / Level Design

Don’t try to force levels in. This will lead to a subpar experience. If you are having trouble making new levels go back and polish the old ones and cut it off at 60. You can then update your game later with new levels or potentially sell new levels in packs of 20, making the first 20 levels free. While I’m not a fan of that business model my point is to cut off the tail and deliver a focused experience.

 
Flag Post

Topic: Off-topic / Anime Addicts Anonymous (AAA)

Don’t confuse “don’t recommend it” with “don’t do it”. Everybody is different in what they enjoy and what they can process. Steins;Gate deals with some complex, albeit scientifically inaccurate, subjects and keeping track of everything can be rather difficult, especially if you are just starting out and aren’t used to subtitles yet (do note this specific sub-point is only valid if the person is watching subbed and not dubbed – I am of the subbed persuasion). As you also mentioned there are a few references in there that may be missed, and while it is not a huge issue in this situation I do believe that certain shows should only be watched after achieving a certain level of understanding of Japanese and otaku culture. I’ve made the mistake of watching shows without the prerequisite knowledge (Steins;Gate, Ghost in the Shell, and Hayate no Gotoku are good examples) and I sincerely regret it. There are also issues of how much of the source material you need to know in order for the adaptation to make sense.

My point is that certain shows need a certain level of knowledge and comfort with the medium in order to really enjoy them – Steins;Gate is one of them. Zankyou no Terror is actually an excellent introductory series when it comes to thriller anime. The story is really easy to follow and 99% of the plot is actually explained without having to look back at source material. There is also a small (although weak) love/slice of life subplot.

 
Flag Post

Topic: Game Programming / Game focus

Unfortunately I can’t help you beyond that. If the option is not there you would need to go into the engine itself and fix it (or add it in once you publish, but that is usually much harder). Game Maker isn’t the most…flexible…engine.

 
Flag Post

Topic: Game Programming / Game focus

http://gamemaker.info/en/manual/302_01_graphics

 
Flag Post

Topic: Off-topic / Anime Addicts Anonymous (AAA)

Aoi Bungaku series is also a pretty good thriller

That show was ridiculously dry.

Originally posted by sddsdd:

FLCL may be one of the most amazing things I’ve ever seen.

Very overrated. If you liked it, though, I recommend you watch Robocop if you have about an hour of spare time. Similar random shit that people attach meaning to when there is none.

One of the best thriller anime out there IMO is Steins;Gate, although it’s got a different feel to it than Another. Still, I advise you to give it a try.

I don’t recommend Steins;Gate to somebody who has just started watching anime. It’s a little too complex for an entry series.

 
Flag Post

Topic: Game Programming / How do I change the size of my game?

I’ll try to conceptualize this for you.

Most game engines contain a data structure called a “Rectangle”. As you would imagine, this rectangle has an X coordinate, a Y coordinate, a width, and a height. These game engines will embed a sprite into that rectangle using internal math and UV coordinates. With that said, when the size of the rectangle is increased, the internals of the engine will also stretch the image to fill the rectangle.

You can usually specify the dimensions of the rectangle based on the viewport size. For example:

Image myImage = new Image("PATH_OF_IMAGE", optionalImageWidth, optionalImageHeight);

//Ensures the image is the same ratio regardless of screen size. This image
//will ALWAYS have a width of 1/20 of the screen (put this in your tick/update method)
//if the user can change the window size manually

myImage.Width = Viewport.Width / 20;

//Absolute image size - the image will always be X pixels wide regardless
//of screen size.

myImage.Width = 64;
 
Flag Post

Topic: Game Design / Does my concept suck?

Depth over breadth, my friend. Best of luck, and let us know what you end up doing.

 
Flag Post

Topic: Game Design / Does my concept suck?

This idea would totally work as a small app. You will need some kind of aesthetic to make it work though. Simplistic is good and all but simplistic art only works when the game has depth. The mechanics you described aren’t deep – this isn’t necessarily a bad thing, but you need to do something to make your game stand out and different from other games.

 
Flag Post

Topic: Game Programming / Newb, Flash CS4?

If you plan on programming as a hobby AS3 is a good way to go. If you plan on turning that hobby into something more (assuming you drop physics for some reason) you should look into C/C++ or C# (or Java if you hate yourself).

 
Flag Post

Topic: Game Programming / Trying to understand avoiding memory leak

That, and you don’t necessarily want to rely on the garbage collector unless you have to (pool your objects when you can)

I was going under the assumption that all the OP cared about was ensuring 0 leaked bytes, not how it would affect performance. But yes, garbage collection is EXTREMELY slow in every language, so you want to avoid both null pointers and having the GC run in the first place. Pools are one of the greatest ways to avoid garbage collection and memory leaks while improving the overall speed of your application.

 
Flag Post

Topic: Game Programming / Trying to understand avoiding memory leak

In almost all high level languages except C/C++ garbage collection is done for you. If your language of choice does not allow you to access memory directly you are safe.

Using your example, if you have a class called fighterData and pass an object as an argument to the constructor, one of two things will happen depending on whether the object is a value type or a reference type. If it is a value type, a copy of the object will be passed to fighterData and that “clone” object will delete itself at the end of the constructor method. If the object is a reference type a pointer to the object will be passed. This object is not deleted at the end of the constructor method (the pointer reference will be deleted), but instead will delete itself when the object no longer has a reference pointer to it. When it comes to the C-based languages the only language you need to worry about the latter for is C++.

Nowadays it is pretty difficult to unintentionally cause a memory leak unless you are dealing with IO (once again, except for C++ where you need to delete your own data).