• What do you need help with? Version 1
    5,001 replies, posted
I'm a beginner to all things programming but I've been aching to try and make some games. I'm an avid fan of indie game development and was wondering if anyone could advise a good entry level language I could use to create some simple, 2D games. I've been researching around online but have been finding it difficult to discover what other indie game developers use. I'm considering using python and pygame to start with, although I've also been reading into Flash, C# and actually using something like Game maker as a basis. Does anyone have any good advice on this subject? I would like to learn the fundamentals of programming as well as making things I can use.
[QUOTE=Aki;23821279]I'm a beginner to all things programming but I've been aching to try and make some games. I'm an avid fan of indie game development and was wondering if anyone could advise a good entry level language I could use to create some simple, 2D games. I've been researching around online but have been finding it difficult to discover what other indie game developers use. I'm considering using python and pygame to start with, although I've also been reading into Flash, C# and actually using something like Game maker as a basis. Does anyone have any good advice on this subject? I would like to learn the fundamentals of programming as well as making things I can use.[/QUOTE] Python and pygame.
[QUOTE=haushippo;23817078]50% uptime and broken mimetypes are fucking awesome. totally. give up and use dropbox.[/QUOTE] Your opinion isn't the only one, you know? I'm not saying dropbox is bad, but I still use imageshack sometimes and even though people generally bash image hosts like it, I've found it rather good.
I'm having problems using RubyGame to create a basic tiling engine for use in a game I'm making. The console returns the following error when I try to run it: [code]C:/Ruby191/lib/ruby/gems/1.9.1/gems/rubygame-2.6.4/lib/rubygame/sprite.rb:182:in `draw': undefined method `blit' for nil :NilClass (NoMethodError) from C:/Documents and Settings/Rhys/digrobo/lib/player.rb:15:in `draw' from game.rb:45:in `draw' from game.rb:27:in `block in run!' from game.rb:25:in `loop' from game.rb:25:in `run!' from game.rb:51:in `<main>'[/code] The code for the program is as follows: game.rb: [code]#!/usr/bin/env ruby require 'rubygems' require 'rubygame' require 'digrobo.rb' Rubygame.init() class Game def initialize @screen = Rubygame::Screen.new [640,480], 0, [Rubygame::HWSURFACE, Rubygame::DOUBLEBUF] @screen.title = "Generic Game!" @queue = Rubygame::EventQueue.new @clock = Rubygame::Clock.new @clock.target_framerate = 30 @player = Player.new 100, 100 end def run! loop do update draw @clock.tick end end def update @queue.each do |ev| case ev when Rubygame::QuitEvent Rubygame.quit exit end end end def draw @screen.fill [0,0,0] @player.draw @screen @screen.flip end end g = Game.new g.run![/code] digrobo.rb [code]require 'lib/player.rb'[/code] lib\player.rb [code]require 'rubygems' require 'rubygame' class Player include Rubygame::Sprites::Sprite attr_accessor :vx, :vy, :speed def initialize x, y @vx, @vy = 0, 0 @playerSprite = Rubygame::Surface.load "lazzy.png" @rect = Rubygame::Rect.new x, y, @playerSprite.size super() end end[/code] I've tried to figure out what's causing the error with no luck. Any suggestions?
[QUOTE=ralle105;23813267]I betcha it's the debug prints that makes it lag.[/QUOTE] I removed the prints and it still lags/doesn't work.
New problem, for some reason my perlin noise sometime's get higher then 1, anyone knows why ? code : [cpp] private float PerlinNoise_1D(float x) { float total = 0; float persistance = float.Parse(persTextBox.Text.Replace(".",",")); float oldFrequency = float.Parse(freqTextBox.Text.Replace(".", ",")); float octaves = float.Parse(octTextBox.Text.Replace(".", ",")); for (int i = 0; i < octaves; i++) { float frequency = (float)Math.Pow(oldFrequency, i); float amplitude = (float)Math.Pow(persistance, i); total += InterpolateNoise(frequency * x) * amplitude; } return total; } private float InterpolateNoise(float x) { int intX = (int)x; float fraqX = x - intX; float v1 = PerlinNoise.SmoothNoise(intX); float v2 = PerlinNoise.SmoothNoise(intX + 1); return PerlinNoise.CosineInterpolation(v1, v2, fraqX); } [/cpp] PerlinNoise class : [cpp] class PerlinNoise { public static float Noise1(int x) { x = (x<<13) ^ x; return (float)( 1.0 - ( (x * (x * x * 15731 + 789221) + 1376312589) & 0x7fffffff) / 1073741824.0); } public static float SmoothNoise(int x) { return (Noise1(x) / 2 + Noise1(x - 1) / 4 + Noise1(x + 1) / 4); } public static float LinearInterpolation(float a, float b, float x) { return a * (1 - x) + x * b; } public static float CosineInterpolation(float a, float b, float x) { float ft =(float)(x * Math.PI); float f = (float)(1 - Math.Cos(ft)) * .5f; return a * (1 - f) + b * f; } } [/cpp]
-snip
[QUOTE=DividesByZero;23822019]I'm having problems using RubyGame to create a basic tiling engine for use in a game I'm making. The console returns the following error when I try to run it: [code]C:/Ruby191/lib/ruby/gems/1.9.1/gems/rubygame-2.6.4/lib/rubygame/sprite.rb:182:in `draw': undefined method `blit' for nil :NilClass (NoMethodError) from C:/Documents and Settings/Rhys/digrobo/lib/player.rb:15:in `draw' from game.rb:45:in `draw' from game.rb:27:in `block in run!' from game.rb:25:in `loop' from game.rb:25:in `run!' from game.rb:51:in `<main>'[/code] The code for the program is as follows: -snip- I've tried to figure out what's causing the error with no luck. Any suggestions?[/QUOTE] Are you sure you're using the right player.rb? You have a nil value and you're calling .blit on it, but it says you're doing that on line 15 of player.rb, but the file you posted doesn't even have 15 lines, much less a draw method.
[QUOTE=Agent766;23815689]I just compiled SFML for VS2010. When I try to run my program, I get a single warning: [code]Warning 1 warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library C:\Users\Jake\Documents\Visual Studio 2010\Projects\Roguelike\Roguelike\LINK Roguelike [/code] What do I need to do?[/QUOTE] I always get that, it doesn't matter
I'm drawing a grid of 1000x1000 quads (textured), the ones that can't be seen are not drawn but the loop still has to go through them to check if they are in the view or not. It takes 80ms to render. Is that normal for immediate mode in OpenGL? There are on average 80 quads in the view.
Alright. I stopped the lag, but onto the next problem. [cpp] public void update( long timePassed ) { // call collision check if velocityX/Y has a value. if ( velocityX != 0 ) { // Check for a collision. if ( velocityX > 0 ) aCollision = runCollisionCheck( "right" ); else if ( velocityX < 0 ) aCollision = runCollisionCheck( "left" ); //System.out.printf( "RUNNING COLLISION CHECK (%s)\n", aCollision ); if ( aCollision == false ) { // So if velocity is distance / time, then // distance = velocity * time. x += velocityX * timePassed; } else if ( aCollision == true ) { velocityX = 0; //System.out.println( "STOPPING CHARACTER (X)" ); } animation.update( timePassed ); } }[/cpp] The collision is checked in here, the update function is called in [cpp]public void gameUpdate( long timePassed )[/cpp] Which is called in [cpp] public void run( ) { //System.out.println( "Inside run" ); long beforeTime, afterTime, timeDiff, sleepTime, timePassed, cumulativeTime; long period = 10; long overSleepTime = 0L; int noDelays = 0; cumulativeTime = System.currentTimeMillis( ); isRunning = true; while ( isRunning ) { beforeTime = System.currentTimeMillis( ); timePassed = System.currentTimeMillis( ) - cumulativeTime; cumulativeTime += timePassed; gameUpdate( timePassed ); gameRender( ); gameDraw( );[/cpp] The problem is sometimes you can run through the wall and other times you can't: is there anyway to make it faster/check more often for the collision, make it more certain if their is a collision? Because right now if you're lucky you just keep on runnin'
[QUOTE=Darwin226;23823030]I'm drawing a grid of 1000x1000 quads (textured), the ones that can't be seen are not drawn but the loop still has to go through them to check if they are in the view or not. It takes 80ms to render. Is that normal for immediate mode in OpenGL? There are on average 80 quads in the view.[/QUOTE] Are they just tiles in a normal grid? If so you can just loop through the part of the array that contains visible tiles. It's fairly easy to calculate where to start and end horizontally and vertically using the camera's position divided by the size of the tile on-screen.
It's an isometric projection so a bit more effort would be required. I do know how to do it, it just isn't a priority yet. I'm pretty satisfied with 80ms without optimizations on one million tiles.
[QUOTE='[ApS] Elf;23823034']Alright. I stopped the lag, but onto the next problem. [cpp] public void update( long timePassed ) { // call collision check if velocityX/Y has a value. if ( velocityX != 0 ) { // Check for a collision. if ( velocityX > 0 ) aCollision = runCollisionCheck( "right" ); else if ( velocityX < 0 ) aCollision = runCollisionCheck( "left" ); //System.out.printf( "RUNNING COLLISION CHECK (%s)\n", aCollision ); if ( aCollision == false ) { // So if velocity is distance / time, then // distance = velocity * time. x += velocityX * timePassed; } else if ( aCollision == true ) { velocityX = 0; //System.out.println( "STOPPING CHARACTER (X)" ); } animation.update( timePassed ); } }[/cpp] The collision is checked in here, the update function is called in [cpp]public void gameUpdate( long timePassed )[/cpp] Which is called in [cpp] public void run( ) { //System.out.println( "Inside run" ); long beforeTime, afterTime, timeDiff, sleepTime, timePassed, cumulativeTime; long period = 10; long overSleepTime = 0L; int noDelays = 0; cumulativeTime = System.currentTimeMillis( ); isRunning = true; while ( isRunning ) { beforeTime = System.currentTimeMillis( ); timePassed = System.currentTimeMillis( ) - cumulativeTime; cumulativeTime += timePassed; gameUpdate( timePassed ); gameRender( ); gameDraw( );[/cpp] The problem is sometimes you can run through the wall and other times you can't: is there anyway to make it faster/check more often for the collision, make it more certain if their is a collision? Because right now if you're lucky you just keep on runnin'[/QUOTE] Repost for new page.
Ok guys, this is kind of a long one but here it goes. I'm making a 2D RTS game (well, that's the general idea anyways) and I'm at the terrain making part. I want to make it tile based and similar to Starcraft in the way that there are no slightly higher parts, then slightly lower parts but only flat terrain -> ramp -> high ground -> ramp -> higher ground The part I'm stuck at is making the cliffs, I had an idea that each tile would be textures with a 100x500 texture so that the terrain on the lowest level would only have a small rhombus (what an ugly name that is in English...) at the bottom and the rest of the texture would be transparent, while the high grounds would have a larger percent of the texture visible. I could probably work out unit positioning while on or off cliffs pretty easily just by having the unit's Y offset up the level of cliff it's standing on. The questions: 1. Is that a good idea or is there something else that you think would work better (be easier to make)? 2. I have NO idea how to work with NPOT textures. It think I have to use TextureRectangle or something but I really don't know how. The results I got from trying different stuff are: -When just loading and drawing them like normal textures, they wouldn't render correctly. Rotated and just weird in general -When drawing them as TextureRectangle I got this black and white stripes... -When loading and rendering as TextureRectangle I only get white rectangles. Probably the best only so far since they are at least the right dimensions.
I'm planning to redesign my DROD Roguelike tile system. Actually there's a 3 dimension array of tiles : Tile[,,] Tiles Tiles[X, Y, Z] -- Z can be 0, 1 or 2. 0 is for the moving entities, enemies, player. 1 is for middle elements. 2 s for floor/wall/pit, etc. However this isn't elegant and doesn't work well, expecially when I want to add a new layer. Adding a new layer requires the game loop to cycle through a lot more tiles. Would a better solution be having a List<Entity> in each Tile, and have a 2 dimensional tile array? Or is there anything else that's even better?
This code won't actually set the x/y/z components of m_Camera. I think it has to do with it being in a DLL. [cpp] // Set the Camera position m_Engine.m_Camera.m_Eye.x = 0.0; m_Engine.m_Camera.m_Eye.y = 1.0; m_Engine.m_Camera.m_Eye.z = 6.0; m_Engine.m_Camera.m_Target.x = 0.0; m_Engine.m_Camera.m_Target.y = 0.0; m_Engine.m_Camera.m_Target.z = 0.0; m_Engine.m_Camera.m_Up.x = 0.0; m_Engine.m_Camera.m_Up.y = 1.0; m_Engine.m_Camera.m_Up.z = 0.0; [/cpp] [cpp] Velocity::ECamera::ECamera(Velocity::SizeI *a_PortSize) { // Set the FOV m_FOV = 90.0f; // Set the clipping planes m_ClipNear = 0.1f; m_ClipFar = 100.0f; // Calculate the aspect ratio m_AspectRatio = GLdouble(a_PortSize->w / a_PortSize->h); // Select The Projection Matrix glMatrixMode(GL_PROJECTION); // Reset The Projection Matrix glLoadIdentity(); // Set the perspective gluPerspective(m_FOV, m_AspectRatio, m_ClipNear, m_ClipFar); // Select The Modelview Matrix glMatrixMode(GL_MODELVIEW); // Reset The Modelview Matrix glLoadIdentity(); // Reset the Camera vectors m_Eye.x, m_Eye.y, m_Eye.z, m_Target.x, m_Target.y, m_Target.z, m_Up.x, m_Up.y, m_Up.z = 0; } void Velocity::ECamera::Apply() { // Select The Modelview Matrix glMatrixMode(GL_MODELVIEW); // Reset The Modelview Matrix glLoadIdentity(); // Apply gluLookAt(m_Eye.x, m_Eye.y, m_Eye.z, m_Target.x, m_Target.y, m_Target.z, m_Up.x, m_Up.y, m_Up.z); } [/cpp]
Does anyone know the best of removing a vs installation? Even when un-install the software it still leaves bits all over your computer.
[QUOTE=Jimmylaw;23832805]Does anyone know the best of removing a vs installation? Even when un-install the software it still leaves bits all over your computer.[/QUOTE] CCleaner?
When do you use an event and when do you use just a delegate? I mean they seem to do the same thing basically.
[url]http://blog.monstuff.com/archives/000040.html[/url]
[QUOTE=high;23783885]Why the sign function?[/QUOTE] Because that's basically what's happening in a mathematical sense, except shifted by 0.5
[QUOTE=ZeekyHBomb;23802451]What does not work? You could try to watch some variables in the debugger or output them to view if the intersection positions are what you expect them to be.[/QUOTE] [cpp]if(spr_rect.Intersects(col_rect, &intersect)) { if(floor(intersect.Bottom) == floor(intersect.Top)) { SetY(intersect.Top - sprite.GetImage()->GetHeight()); } else if(GetFarX() <= intersect.Right) { SetX(intersect.Left - sprite.GetImage()->GetWidth()); } else { SetX(intersect.Left); } }[/cpp] It works for the side collisions and when the player lands on a block, but if they jump from under the block, nothing happens, they go straight through.
Does anyone know of a good 2d game framework? Preferably in Python or Lua (or something similar to either). I've tried pygame and for some reason couldn't stand it, and could hardly figure it out. And I've recently tried LÖVE and it is pretty good and straight forward but it also feels kind of limiting. I've looked at Flixel and flash punk, but action script looks so... ugly and confusing to me. Thanks!
Pygame for python is pretty popular.
[QUOTE=Funcoot;23841294]Pygame for python is pretty popular.[/QUOTE] Did you read my post? Try it.
Does anyone here have a clue how 3d model files or audio files work? I'm trying to write converters for content that I extracted out of a video game, and these two formats seem to be the most elusive ones. The rest are text based or standard files with a custom header. PM me and I'll send you one of the files.
[U][B]RESOLVED[/B][/U] Hey I am working on a program in Visual Basic .NET 2008 using Winsock. The problem that I have came across is that when a client disconnects, the server goes haywire as it can't find that client and causes it to crash. [IMG]http://i.imgur.com/joyNP.jpg[/IMG] [lua]Code removed to shrink the page since this is resolved[/lua] I need help really quick. If anybody can help or has a good understanding of Winsock and VB .NET and has VB .NET 2008 installed. Please PM me or add me on Steam and I can send you the project as this is urgent. [editline]07:59PM[/editline] Also for some reason it keeps saying that both Host or Admin are set to 0 when they are set to 1 on server launch resulting in commands being blocked when they shouldn't be. [U][B]RESOLVED[/B][/U]
[url=http://msdn.microsoft.com/en-us/library/system.net.sockets.networkstream.read.aspx]See this MSDN page[/url]. Just catch the relevant exceptions (Namely, IOException and ObjectDisposedException) and after that treat the connection as if it was cleanly closed or something.
I need more than that mate. If you actually know how to fix the problem add me to Steam and we can discuss it.
Sorry, you need to Log In to post a reply to this thread.