Recent posts by Rivaledsouls on Kongregate

Flag Post

Topic: Game Programming / [AS3] Virtual Pet Game

Although players could still edit the save file, you can get a more reliable current time using this class (it uses which uses an atomic clock)

//When the game is loaded
NetTime.addEventListener(NetTime.TIME_UPDATED, handleTime);

private function handleTime(e:Event):void{
    //Get current time
    var currentTime:Date = NetTime.getDate();
    //Update based on time
Flag Post

Topic: Game Programming / Programming running blood

I would start with a shader that has bump mapping and specular lighting based off the bump map. I’m not really sure how you go about procedurally generating the textures. But, as far as the concept you should start with a splatter, which would be randomly placed (hemi)spheres of blood of varying sizes. Each frame, move the blood drops based on their size (larger drops fall faster), leaving a trail behind (a line with a width matching the diameter of the drop). Also shrink the drop a little each frame. Once a drop is small enough, it should stop falling. Rendering the drops is a challenge of it’s own. I think that you could treat the trail as a cylinder and the drop itself as a sphere in the bump map and keep the texture flat shaded and it would look pretty good. To make it look like a liquid, I would (using the names of parameters for the standard Unity specular shader) put the shininess up around 75% and make the specular color nearly white, maybe make it slightly transparent.

Flag Post

Topic: Game Programming / GiTD [#27] Entries and Discussion

Cool theme UG, I’ll see if I can pull anything together in a couple weekends.
EDIT: And thanks Orandze for the Day 7 incentive!

Flag Post

Topic: Game Programming / C++ robotic programming without robots

I never tried it, but Microsoft has some software for robotics that says it has a simulator that could give you some experience with the types of issues that come up in real life.

I think it uses C# though, which is roughly C-based but closer to Java than C++.

Flag Post

Topic: Game Programming / How would you do this (#29382)?

If you run into performance issues, it might be better to only add one tween at a time

private var cursorX:int = -1;
private var cursorY:int = 0;
private var tiles:Vector.<Tile>;

private function fade():void{
    if(++cursorX >= tiles.length){
        cursorX = 0; 
        if(++cursorY >= tiles[0].length) return;
    }[cursorX][cursorY], DELAY, {alpha:1,onComplete:fade});

Personally, I almost always use 1D arrays for 2D data because it’s much easier to iterate through. If you need to access a 1D array as if it’s 2D you just do

function getTile(X:int,Y:int):void{
    return tiles[Y*WIDTH+X];

where WIDTH is the maximum x index.

Flag Post

Topic: Game Programming / Interest for GiTD #27? Possible Dates inside

I might find time to enter. September 27th is best for me.

Flag Post

Topic: Game Programming / Porting to PS3, Xbox 360, etc.

- Code once, runs on Windows,Linux,Mac,iOS,Android,Browser,Wii,360,PS3
- Free version, hardly limited, can still export to Web and Computers
- Much easier to use than nearly any other 3D development platform, includes a graphical IDE with built-in level editor
- Contains a bunch of middleware (shadow-mapping, physics, advanced sound, terrain, etc.) at no additional cost, many of which cost thousands of dollars on their own
- Large community and very active development

Best choice for any hobbyist looking to get into making 3D games, hands down, no competition

Flag Post

Topic: Game Programming / Looking for a new language to learn. (AKA Debate! Language 2 Lrn)

I’ve tried many programming languages and am quite aware of what they’re best used for. From what you’re asking for, you seem to be looking for a language that will be easy to use and is well suited for creating desktop applications but you don’t care about heavy-lifting/performance. With these criteria, you’re best off going for a very high-level language .

I’ve personally used Python to great success in creating applications and highly recommend it. You may not like Python’s syntax at first, but concepts like syntactical indenting make your code clean and consistent. Python is not only a pleasure to use, but also makes you a better programmer by enforcing more readable code. Ruby is another great choice, but less mature, so you may not find as many libraries for UI. You might even find a scripting language specifically for some application creating software to best suit your needs.

People can argue for weeks about the advantages and disadvantages of various programming languages, but when it comes down to it, you usually just want something that will get the job done with the least hassle. C++ may seem like a good choice because it’s “the industry standard”, high performance, and gives you access to anything you want, but that all comes at the cost of ease-of-use (I can elaborate if you want me to). A high-level language like Python is rarely going to have you pulling your hair out in the way that C++ would.

Flag Post

Topic: Game Programming / [AS3] Euler vs. Verlet Integration

Verlet is useful if you’re dealing with multiple forces as it makes calculations many times easier. I’ve used Verlet integration for approximating soft-body physics by setting up points connected by a spring force. Trying to solve an arbitrary system of competing springs is basically impossible, but simply moving each points position based on each spring a few times per frame will give you a good estimate using Verlet.

Flag Post

Topic: Game Programming / OpenBOR in flash - how would you do it?

Originally posted by FlashGrenade:
But Feel free to take a look, point out the missteaks, and offer as much constructive critcism as you can.

If you want to share the code to your project and especially if you expect people to help with the project, you should start a repository on something like Github and put the code up there.
Remove the giant blocks of code in that post.

Flag Post

Topic: Game Programming / GiTD [#24] Entries and Discussion

If there’s over $50 in prizes to be won, we should probably try to advertise the comp, we could attract some new competitors. Maybe here

Flag Post

Topic: Game Programming / GiTD [#24] Entries and Discussion

Okay, I’m entering this one. I’m definitely going to finish this time, if the idea I came up with is anywhere near as fun as I imagine it will be.

Considering the theme, can we have a menu,help screen, etc. or should we integrate everything into the game (e.g. starting out at the menu and then starting the game by running off the screen to the right)?

Flag Post

Topic: Game Programming / Javascript game dev ide

I’ve never had an issue with Eclipse. Don’t know what all the hate is about, have yet to see an actual complaint. Eclipse has saved me countless hours, especially with looking up documentation. I couldn’t imagine programming in Java without it. For example, when working with large projects (hundreds of source files), Eclipse makes it nice and easy to navigate, allowing you to quickly open files by hitting a shortcut and typing in the first few letters of the class name. This saved me from going insane at my internship last summer.

Flag Post

Topic: Game Programming / What are some good simple projects or games I could make?

Snake is a good place to start, begin with just the head collecting pellets. Then add growth, and then make it so they lose when the head collides with another segment.

Flag Post

Topic: Game Programming / Making piercing bullets?

Give each bullet an ‘insideEnemy’ property. When the bullet hits an enemy, deal damage and set insideEnemy to the enemy hit. When the bullet is no longer hitting that enemy set insideEnemy to null, or if the bullet hits a different enemy set it to the new enemy.

This is probably the most efficient method. The only shortcoming is that if you are doing pixel perfect or similar collision detection, the bullet could, for example, hit an enemy’s arm, go through a gap, and then hit the enemy’s body, doing double damage.

Flag Post

Topic: Game Programming / Music Streaming

Kongregate will give you 30mb for your game. You can definitely host the music files on a server and load them as the game is running, but you’re probably going to have to pay for the server if you want it to load at all fast. I think you have to reconsider some stuff if you can’t fit all of your music into 30mb. Flash games are supposed to be fairly short and load quickly. You should be using MP3s at no higher than 128 kbps bitrate.

If your game has to load 90mb of music, people will probably give up waiting for it to load before even playing it once.

Flag Post

Topic: Game Programming / Algorithmic symphonies from one line of code

Closest thing to music I could make

Pretty interesting

EDIT: With some tweaks I got it to change notes as the “song” progressed, still sounds awful but closely resembles music

Flag Post

Topic: Game Programming / Time2Game Gaming Contest

Hm, I got a Malware warning trying to go to that site, I wouldn’t trust it.

Flag Post

Topic: Game Programming / HTML5 engine for Empire/RPG games

Wow, this is a very “interesting” topic. del157652, while I agree with you on some points you sound completely insane and are constantly off-topic, even changing subject within a single sentence.
Ahriman, I think you should be careful before you get to invested in HTML5 and other modern web standards. You’ll find that WebSockets are hardly supported and the browsers that do support it are dropping support due to security issues. COMET should be perfectly reasonable using Node.js, there’s several libraries for that.
Canvas is still in it’s infancy and is quite slow, on top of A*, game logic, network communications, and so on, an isometric engine is going to be quite demanding. I would do some performance tests before you get too involved. My experience with canvas is that you can easily make some nice looking graphics similar to Flash, but once you try dropping in 100+ sprites performance becomes an issue.
I personally think that a PHP backend is going to create more stress and require more work than some of the alternatives. I love Ruby on Rails, and find that it makes almost every job easier. There are many tools in place to make it less vulnerable to attacks than PHP, as well as so many “gems” which do 80% of the work for you. There’s a bunch of gems for things like queuing jobs, doing jobs on timed intervals, and various CMS-related tasks which you would likely find helpful. Finally, the code produced in a RoR project is generally more organized and readable than in Java or PHP.
Anyways, looks like you got a lot done and are doing a good job so far. As long as you don’t get too far ahead of yourselves you should do great.

Flag Post

Topic: Game Programming / Passing a Vector as a Function Parameter

You have three options (that I’m aware of).

A) Change function to take Vector.<Sprite>

B) Change vector to be Vector.<DisplayObject> (you can add Sprites to a DisplayObject vector)

C) Change function to take * (item:*). Check if items is a Vector.<DisplayObject> or Vector.<Sprite>, 
if not return an error or something.
Flag Post

Topic: Game Programming / Making a game that uses scroll wheel? Read this!

Perhaps we could convince Kongregate to add a bit of javascript to their site that disables the scrollwheel when the flash game has focus. Mousewheeltrap shows that it’s definitely possible to achieve.

Flag Post

Topic: Game Programming / Can I use AAC in Flash?

There’s not much room for saving space on music embedded in Flash without losing quality. Pretty much your only option besides MP3 is using something like MIDI. There’s a couple of libraries that
will play music files for old consoles like NES and Commodore 64 if you’re going to do chiptunes,
and there’s as3sfxr for 8-bit sound effects.

Short of that, you need to make constant-rate MP3s (Flash limitation, last I’ve checked) at 64-96 kbps for sound effects and dialog and 96-128 kbps for music. You could also try dropping the sample rate to 22050Hz for vocals and some sound effects to get better quality at a lower bitrate, however music will usually noticeably degrade when you drop the sample rate.

Flag Post

Topic: Game Programming / Flixel not clearing screen

What’s in MenuState? That’s probably the source of your issue.

Flag Post

Topic: Game Programming / Additional/external files in a game

Just thought I should add, you can embed the text file into your swf and it will save you a lot of trouble. The only disadvantage to this method is that you have to recompile your game and upload the new swf every time you change the text file. This is only an issue if you plan on changing the text file often, of course.

Flag Post

Topic: Game Programming / Bitmap Fade while retaining alpha

I don’t really get what’s going on. Why exactly can’t you set alpha on the image?
The drawing black in place of transparent portions of images sounds like it’s losing the alpha channel because fully transparent is probably stored as 0×00000000 which is fine in ARGB but in RGB it’s fully opaque black.