Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


bwhiting

Member Since 22 Jul 2010
Offline Last Active Jun 28 2015 03:57 PM

#5234882 Game Development Help Please (language choice)

Posted by bwhiting on 15 June 2015 - 07:42 AM

HTML5 etc....
But for some insane reason they built the game you linked to in flash - very odd considering you can do all that with js, css and html no probs.

Someone should probably let the devs know they made a mistake!

 

In all seriousness though; while web technologies allow you to create games like that, there are still a host of reasons you might not want to use them and would be better of with something else.

 

If the web is your target then html might well be the way to go, if is isn't then don't limit yourself by choosing it.




#5233112 AS3 platformer, making a TileMap scroll.

Posted by bwhiting on 06 June 2015 - 04:28 AM

@Wyrframe, massive points to you for the big effort you are putting in helping out on this one. Folks like you are what make communities like this what they are!

Forums were a big help with my learning many many moons ago so I think it is so important to keep up the tradition of helping people when you can!




#5229810 Virtual Multiple Viewports with Render to Texture (CryEngine 3)

Posted by bwhiting on 19 May 2015 - 07:38 AM

I have not used cryengine 3 but I can't imagine that they don't support render to texture - if they don't that is a real shame, because it makes your task a great deal harder... can't even think how you would do it without it.
:(




#5229781 Communication between objects and systems in Game engines.

Posted by bwhiting on 19 May 2015 - 03:39 AM

you could just create something that manages that task separately, like a player collision manager.

that gets access to the player and the scene and takes care of all the logic it needs inside of its own update function.

 

This way the player stays cleaner as does the engine code.

Plus it gets easier to maintain, say if you wanted to change from a raycast to an ellipsoid collision detection.

It doesn't work for every situation but it keeps things tidy and easy to tweak.
If you only need something really simple you could just do a single raycast and player update in the main update function, should only be a few lines of code.. but then that approach can get messy quickly as things get more complex.

 

All that said there are many many ways to skin a cat :)




#5219283 Skeletal animation issues

Posted by bwhiting on 26 March 2015 - 05:21 AM

I am working on something similar at the moment and what I did was to render things on on the cpu as an overlay showing the positions of each of the transformed nodes to ensure they all line up properly visually.

 

It is pretty easy to do and very useful for debugging, essential you draw a line from each transform to it's parent if it has one, that way you can start to isolate where the issue is as with skinning there are many points of failure, from the shaders to the interpolation to the correct hierarchies.

 

Also for testing I made a simple 3 bone test shape and also exported the bone geometry - so much easier to debug when you are dealing with a simple 3 bone 2 parent system :D

 

Best of luck!!




#5218528 Programmatic Pixel Art

Posted by bwhiting on 23 March 2015 - 11:53 AM

Sure it would work, and you could indeed build something like that for fun.

But when you want to add colour, and have larger images it is going to be severely limiting.

Drawing images will always be so much faster with image editing software than editing text... and if  you wrote a converter (image->text) well then it is self defeating as the image will generally compress much smaller/faster and be faster to decode.

If you used a raw array of data then you could just use a memcopy to create an image, and that would be fast - but might not worth the effort to geneate the code anyway in the first place, as it would no doubt take up more space.

 

That said... I have done this exact kinda thing before in a tiny console utility, I cached the bitmap data for the characters 0-9 in 10 unsigned integers in an array.
the first 24 bits described the character's shape (4x6 grid) and then the other bits can be used to store metadata such as the characters width in pixels.

 

This enabled me to blit numbers to a bitmap very quickly with very little data - just 1 uint to describe the pixels of a character :D




#5216813 Best Language to Program a Facebook game in?

Posted by bwhiting on 16 March 2015 - 03:58 AM

Erm I have no idea why everyone thinks flash is dead  or slow here, it works fine on desktops and will work fine on devices too if you want (just export with same code using air).

 

For quite some time flash has been the go to tech for facebook games - this is not without reason.

It also supports vector graphics and has better 3d support through stage3d than html does at the moment.

 

"There is literally nothing that Flash can do that HTML5 cannot" well not quite literally rolleyes.gif 

Animated optimized vector graphics, compressed source, compiled source (not so easy for someone to just change your in game values), compressed pngs, easy use of fonts, anti aliasing, smoothing bitmaps, blend modes, code hinting, solid performance analysis tools, 1 click deploy to web, android or ios without any extras needed, sub pixel positioning, DRM support, fullscreen support that doesn't crash all the time, easy binary manipulation, works in very old browsers (no need to write your own array.indexOf implementation...), same across browsers, rapid prototyping using flash ide.... am sure there are more too.

 

Not to mention you can avoid js - always a bonus.

 

Performance with flash is not a problem for any decent developer. No browser is going to outright stop supporting flash anytime soon either.

Even if you build it in flash first, then port it down the line if you have to that might be a better idea, as you will have a working game build faster already.

 

Just to clarify, I write games in flash, js and unity - and when it comes to facebook games like the op wants- flash is the better/faster option.




#5214495 Bitmap graphics pixels scanning

Posted by bwhiting on 04 March 2015 - 09:23 AM

Ah it was more for an example of the result not really the implementation, there is much more going on there than you need to be interested in.

Take a look here:

http://www.roborealm.com/help/Convolution.php

or here:

http://www.hoomanr.com/Demos/Filters2/

and choose the convolution filter and plug in the numbers from the first link

or here for some code in js you can easily port to java:

http://www.html5rocks.com/en/tutorials/canvas/imagefilters/




#5214183 Bitmap graphics pixels scanning

Posted by bwhiting on 03 March 2015 - 06:24 AM

dammit, wrote you a long reply and accidentally closed the tab and lost it :(

 

in summary you made a good start but with a flawed approach, hard coded values won't work well given the unpredictability of the users lighting conditions.

 

You are better of using a edge/feature detection type solution. The idea being to compare each pixel against its surroundings and extract its contrast from that.

i.e sample some neighbouring pixels and compare luminance against those.

 

Take a look at some common convolution filters for some ideas.

Here is an example I made where I run them on the gpu:

http://blog.bwhiting.co.uk/?p=223




#5203866 Weird framerate drop

Posted by bwhiting on 13 January 2015 - 03:22 AM

Just to echo Sean, who is probably right with regards to the cause of your issues, when writing games in languages like Java, object pools are your friend! The stop the GC having to do much work at all while your game is running.

 

Just have a look through your game code an if you are seeing any "new Vector2D, new GameObject, new Texture2D, or anything like that then you are already wasting CPU.

 

At the start of a level (or earlier) you can just create pools of these objects and then get them from your pool when you need them and put them back when you are done. The code for these are really easy to do and the impact they create in memory managed languages can be huge.

 

e.g.

//in game loop somewhere

GameObject badGuy = GameObjectPool.getGameObject();   //new GameObject();

//later on

GameObjectPool.returnGameObject(badGuy);    //badGuy = null;

 

Your aim should be as close to zero allocations during game-play as possible - reuse the living crap out of everything you can.




#5202830 Programming a Level Editor

Posted by bwhiting on 08 January 2015 - 08:12 AM

https://www.youtube.com/watch?v=taX4h3UajBc

 

There is a little video of a "simple" level editor that the guys made for overgrowth, it is pretty neat - very few features but enough to start building levels with.

The bare minimum is a load/save level function, a load object function, and move/rotate/scale functions.

After that you can expand into material editing but in reality you can do that in the code initially easy enough.

 

:)




#5200750 making a serious game in flash

Posted by bwhiting on 30 December 2014 - 05:45 AM

Should be possible but there are some caveats. If the game is huge and complex (i.e. 3D, networked, large levls, complex behaviours, etc...) then flash will probably not be able to compete with other technologies, but then if that is your target it is going to be an uphill struggle whatever you use.

 

Pros:

Fast to get things working,

AS3 is easy to develop in and debug (especially with the right ide - use FlashDevelop it is free pretty powerful).

Flash, despite what a lot of people think is fast, thousands of on screen sprites are no problem if you use Stage3D (GPU).
You could (depending on mechanics) easily port the game to android and IOS.
You could allow people to play a "demo" version online before they even have to download the full game.. which is neat.

The Flash IDE makes building ui and assets very easy.

 

Cons:

Flash is not as quick as c++ or c#... but it isn't a million miles away.

Some useful language features are missing but it is not prohibitive.

People just don't like flash.

 

What kind of game are you thinking of, if you were able to share with us a brief of some kind we could probably let you know if flash is up to the task.




#5197128 Drawing many enemies

Posted by bwhiting on 09 December 2014 - 04:58 AM

I did a demo here of upto 100,000 animated sprites that can run in a flash enabled browser providing you have a machine decent enough to handle it.

http://blog.bwhiting.co.uk/?p=476

The source can be seen here:

https://github.com/bwhiting/b2dLite

It uses indirect addressing in the shader to batch as many draws into one draw call as possible.

 

The technique means you don't have to modify vertex buffers every frame, but rather offset everything with shader constants.

 

You can do it the other way too, by just modifying vertex buffers on the cpu and re-uploading them and it will enable you to batch much greater numbers together than the method I used but each has it pros and cons.

 

On many devices I have found the approach I used to perform better anyway, and it also scales better with more complex meshes, as you have less data to update on the CPU every frame (same for 4 verts as for 40 or even 400). But you are limited by how many vertex constants you can upload.




#5188618 Scenes with large and small elements

Posted by bwhiting on 22 October 2014 - 04:00 PM

probably not much help but pretty cool all the same:

http://www.andrewtop.com/Projects/Linfinity

 

also might be worth looking at the answer to this q:

http://stackoverflow.com/questions/1930421/seamless-transitions-of-scale-over-large-distances-3d-rendering




#5187112 How to Separate the Rendering Code from the Game Code

Posted by bwhiting on 15 October 2014 - 02:49 AM

Just to kind of echo Promit, that is how I separate the two.

 

A render lib can essentially be as simple as this:

 

function render(material, geometry)

{

     //rendering done here

}

 

The your game/app is just a system where by you organise a series of calls the the renderer.render function by whichever means suits your purpose.

 

The renderer  knows nothing of how you structure your game/app, it just sits there waiting for things to draw.

What you draw, the order you draw it, where you draw it... all this information is constructed outside of the renderer.

 

(obviously this is just high level speak and things can get a little more complex but in general you can make things work like this and it is very flexible)

 

For instance, a wrote a quick space shooter game using a bitmap blitting renderer and once it was done I was able to swap out the renderer like for like for a GPU based one. Took next to no time at all because there was so very few connections between the two systems.






PARTNERS