• What do you need help with? Version 5
    5,752 replies, posted
[QUOTE=LaughingStock;35308345]I was thinking about keeping the frame on for a bit longer before clearing the screen but I'm not sure how to do that.[/QUOTE] That's what I mean. Draw the picture, do a bunch of meaningless calculations to kill time, draw the next picture. Here's what I use: [code] 0->I While D > I I + 1 -> I End [/code] When I need to delay something, usually for animation, I just throw a number into D and then call the program called DELAY. It works pretty well.
That seems to work nicely. There's still a bit of flicker but that's not avoidable right?
[QUOTE=LaughingStock;35309411]That seems to work nicely. There's still a bit of flicker but that's not avoidable right?[/QUOTE] I'm not entirely sure, because I get a bit of a flicker myself. The calculator scripting language was designed to implement algorithms quickly, and so no "sleep" or "pause" functionality was implemented. This is simply a "machine dependent" workaround that works well enough and doesn't look horrible. Tweak how long you make it wait until it looks the best it can.
Anyone know of a good, simple 2D game engine that I could possibly just fuck around on?
[QUOTE=Rayjingstorm;35309585]I'm not entirely sure, because I get a bit of a flicker myself. The calculator scripting language was designed to implement algorithms quickly, and so no "sleep" or "pause" functionality was implemented. This is simply a "machine dependent" workaround that works well enough and doesn't look horrible. Tweak how long you make it wait until it looks the best it can.[/QUOTE] [del]Oh whoops. The while loop should be a repeat loop in your example, that threw me off a bit. I was wondering why nothing would happen when I entered extremely long numbers.[/del] I take that back, i'm not sure what's going on. Actually, nevermind, I'm not actually running the other program I think. [QUOTE=Sickle;35309966]Anyone know of a good, simple 2D game engine that I could possibly just fuck around on?[/QUOTE] You'll have to shell out a ton of money if you actually want to do something semi-serious, but construct is a nice drag and drop game creator thingy. It has its own language too.
I have C# / .NET Question: I have a console-based program that performs operations on a data set. I need to have a WinForm that can access that data and update itself when the data changes (asynchronously). How would I go about sharing the data across Threads and updating the WinForm?
DirectX and GLM are giving me totally different results for Perspective matrices. I'm using the following code to generate both: [code]void CRender3D::CreateViewProjMatrix() { D3DXMatrixIdentity(&m_ViewProj.proj); D3DXMatrixIdentity(&m_ViewProj.view); D3DXMatrixPerspectiveFovLH(&m_ViewProj.proj, 45.0f, g_pVideo->GetWidth() / g_pVideo->GetHeight(), zNear, zFar); //VIEW D3DXVECTOR3 eye = D3DXVECTOR3(0.0f, 1.0f, -10.0f); D3DXVECTOR3 lookAt = D3DXVECTOR3(0.0f, 1.0f, 0.0f); D3DXVECTOR3 Up = D3DXVECTOR3(0.0f, 1.0f, 0.0f); D3DXMatrixLookAtLH(&m_ViewProj.view, &eye, &lookAt, &Up); m_glmViewProj.proj = glm::perspectiveFov(45.0f, g_pVideo->GetWidth(), g_pVideo->GetHeight(), zNear, zFar); m_glmViewProj.view = glm::lookAt(glm::vec3(0.0f, 1.0f, -10.0f), glm::vec3(0.0f, 1.0f, 0.0f), glm::vec3(0.0f, 1.0f, 0.0f)); }[/code] When compared in the debugger, the View matrice generated by both GLM and DirectX match. However, the Perspective matrices are totally different, some values are negative in one and not the other, and lots of totally different numbers (a 1 instead of a 2, etc.) I'm transposing both matrices before I upload them to the GPU. If I use DirectX's Proj and GLM's View my models show up fine. If I use GLM's Proj and View, nothing shows up (being transformed behind the camera I would assume, models are rendered with a identity matrix for their world). I don't know why GLM is giving me such a cockeyed result :/
[QUOTE=ROBO_DONUT;35298148]Some games have a separate TCP connection for this, while others build a reliable layer on top of the existing UDP connection. Personally, I'd go with the latter solution, as it gives you the flexibility to have separate reliable 'streams' and such over one connection, or provide reliable non-ordered streams or unreliable ordered streams, etc. There probably libraries out there that would do this for you.[/QUOTE] Just to chime in here - using TCP for this purpose is a lot better than re-implementing TCP using UDP. TCP has been rigorously tested and works well, there's no point duplicating this work. Not to mention most network hardware is optimised to speed up this kind of behaviour only when working with TCP packets. There are of course exceptions to this, but generally I use TCP for reliable and UDP for unreliable.
I'm considering making a flash game, what language should I learn? I have shallow experience in Java and Lua. Also, any estimate on cost?
[QUOTE=Spearman;35312763]I'm considering making a flash game, what language should I learn? I have shallow experience in Java and Lua. Also, any estimate on cost?[/QUOTE] Cost: Zero Flixel + FlashDevelop + Flex SDK will get you compiling flash games for no cost. Learn AS3, it's Flash's language.
[QUOTE=LaughingStock;35310138] You'll have to shell out a ton of money if you actually want to do something semi-serious, but construct is a nice drag and drop game creator thingy. It has its own language too.[/QUOTE] I'm looking for practice right now, but one thing that I forgot to specify was that it needs to be in Java. But thanks.
[QUOTE=Lord Ned;35312040]DirectX and GLM are giving me totally different results for Perspective matrices. I'm using the following code to generate both: [code]void CRender3D::CreateViewProjMatrix() { D3DXMatrixIdentity(&m_ViewProj.proj); D3DXMatrixIdentity(&m_ViewProj.view); D3DXMatrixPerspectiveFovLH(&m_ViewProj.proj, 45.0f, g_pVideo->GetWidth() / g_pVideo->GetHeight(), zNear, zFar); //VIEW D3DXVECTOR3 eye = D3DXVECTOR3(0.0f, 1.0f, -10.0f); D3DXVECTOR3 lookAt = D3DXVECTOR3(0.0f, 1.0f, 0.0f); D3DXVECTOR3 Up = D3DXVECTOR3(0.0f, 1.0f, 0.0f); D3DXMatrixLookAtLH(&m_ViewProj.view, &eye, &lookAt, &Up); m_glmViewProj.proj = glm::perspectiveFov(45.0f, g_pVideo->GetWidth(), g_pVideo->GetHeight(), zNear, zFar); m_glmViewProj.view = glm::lookAt(glm::vec3(0.0f, 1.0f, -10.0f), glm::vec3(0.0f, 1.0f, 0.0f), glm::vec3(0.0f, 1.0f, 0.0f)); }[/code] When compared in the debugger, the View matrice generated by both GLM and DirectX match. However, the Perspective matrices are totally different, some values are negative in one and not the other, and lots of totally different numbers (a 1 instead of a 2, etc.) I'm transposing both matrices before I upload them to the GPU. If I use DirectX's Proj and GLM's View my models show up fine. If I use GLM's Proj and View, nothing shows up (being transformed behind the camera I would assume, models are rendered with a identity matrix for their world). I don't know why GLM is giving me such a cockeyed result :/[/QUOTE] OpenGL uses a more traditional single column format for transformations where DirectX uses a single row format. So if you're transformations are setup A x B in OpenGL, the same operation would look like Btranspose x Atranspose in DirectX. I hope that isn't too confusing.
I know my way around the C# and .net framework, now I think I could do a "detour" to other languages too. I tought of java(eclipse looks sexy for me) and its advantages, but the lack of nifty operator overloading and delegates are distracting me from that. So which language should I give a go? C# (I have the most experience in that), C++(I can do anything in that with sfml, know a little stl), Java, or C
I would suggest C or something completely different - e.g. Haskell or Ruby. But before you switch, come up with a reason to switch. Visual Studio for C# is a wonderful environment to program in, and once used to IntelliSense and how well it works with VCS you'll probably miss it regardless of whatever else you end up using.
[QUOTE=ThePuska;35316201]I would suggest C or something completely different - e.g. Haskell or Ruby. But before you switch, come up with a reason to switch. Visual Studio for C# is a wonderful environment to program in, and once used to IntelliSense and how well it works with VCS you'll probably miss it regardless of whatever else you end up using.[/QUOTE] I used Visual Studio for programming in C# for several monts, and loved it. Then I switched to Linux, and C/C++ and I've never missed it. Typing a few extra letters doesn't matter unless you're doing it thousands of times, in which case it's not a problem anyway, since I'm using vim.
I got an assignment for my C++ class, it seems fairly hard considering we have never done anything to do with GUI's before. But we have to make a "Game Compendium", where you select either Connect four, Snakes and Ladders or Checkers. We have to code all 3 games and get it working with either a GUI or in a console, but we will be doing a GUI since it will carry higher marks. Any advice on this? I've never attempted making games before. We also have a Software Testing module to go alongside this, and have to develop a Test Plan. So yeah, any help on the coding aspect. I've been pretty down lately about how much work I have for college, we have 4 weeks left and have 7 assignments and 3 exams due within 4 weeks, and only got all assignments this week, so if anybody could help me out I would really appreciate it.
[QUOTE=Over-Run;35317117]I got an assignment for my C++ class, it seems fairly hard considering we have never done anything to do with GUI's before. But we have to make a "Game Compendium", where you select either Connect four, Snakes and Ladders or Checkers. We have to code all 3 games and get it working with either a GUI or in a console, but we will be doing a GUI since it will carry higher marks. Any advice on this? I've never attempted making games before. We also have a Software Testing module to go alongside this, and have to develop a Test Plan. So yeah, any help on the coding aspect. I've been pretty down lately about how much work I have for college, we have 4 weeks left and have 7 assignments and 3 exams due within 4 weeks, and only got all assignments this week, so if anybody could help me out I would really appreciate it.[/QUOTE] I have made the Snake game in Pascal, you can download the source code here [url]http://fit.faccat.br/~a1110207/cobra.pas[/url] its pretty simple and this will give you an idea in how to make the other games. Edit: Ops, It's "Snakes and Ladders".. I dont even know this game, my bad.
[QUOTE=Over-Run;35317117]I got an assignment for my C++ class, it seems fairly hard considering we have never done anything to do with GUI's before. But we have to make a "Game Compendium", where you select either Connect four, Snakes and Ladders or Checkers. We have to code all 3 games and get it working with either a GUI or in a console, but we will be doing a GUI since it will carry higher marks. Any advice on this? I've never attempted making games before. We also have a Software Testing module to go alongside this, and have to develop a Test Plan. So yeah, any help on the coding aspect. I've been pretty down lately about how much work I have for college, we have 4 weeks left and have 7 assignments and 3 exams due within 4 weeks, and only got all assignments this week, so if anybody could help me out I would really appreciate it.[/QUOTE] Connect Four sounds like the easiest rules to implement to me. Are you provided with any GUI libraries? Are there any restrictions on what you can use?
[QUOTE=Mete;35317760]I have made the Snake game in Pascal, you can download the source code here [url]http://fit.faccat.br/~a1110207/cobra.pas[/url] its pretty simple and this will give you an idea in how to make the other games. Edit: Ops, It's "Snakes and Ladders".. I dont even know this game, my bad.[/QUOTE] Haha its cool man thanks a lot for the source code I can have a look at it anyway and could provide some help :) [editline]27th March 2012[/editline] [QUOTE=calzoneman;35317884]Connect Four sounds like the easiest rules to implement to me. Are you provided with any GUI libraries? Are there any restrictions on what you can use?[/QUOTE] Yeah connect 4 will probably be the easiest to do, checkers will be a bitch I would say. And I don't think so, as far as I know we just use the standard C++ library. No extras. But I will have to find out
[QUOTE=ahdge;35314454]OpenGL uses a more traditional single column format for transformations where DirectX uses a single row format. So if you're transformations are setup A x B in OpenGL, the same operation would look like Btranspose x Atranspose in DirectX. I hope that isn't too confusing.[/QUOTE] Starting with DirectX 10, matrices need to be transposed before being sent to the GPU (a-la OpenGL) - It's not the order of numbers that is different it's the actual values. Shouldn't creation of a perspective matrix still have the same values (even if in a different end order)?
could anyone point me towards some good tutorials for integrating lua into c++?
[QUOTE=Richy19;35320670]could anyone point me towards some good tutorials for integrating lua into c++?[/QUOTE] pil
Why does the client player move smooth but the other players move jittery to the client? Here is the game loop pertaining to that: [cpp]if(gamefocus){ if(sf::Keyboard::isKeyPressed(sf::Keyboard::D)){ commands[num+1] +=1; you.rect.move(250*tick,0); } if(sf::Keyboard::isKeyPressed(sf::Keyboard::A)){ commands[num+1] +=2; you.rect.move(-250*tick,0); } if(sf::Keyboard::isKeyPressed(sf::Keyboard::W)){ commands[num+1] +=4; you.rect.move(0,-250*tick); } if(sf::Keyboard::isKeyPressed(sf::Keyboard::S)){ commands[num+1] +=8; you.rect.move(0,250*tick); } } for(int x = 0; x <players.size(); x++){ players[x].rect.setPosition(players[x].position[num*2], players[x].position[num*2+1]); }[/cpp] I get a server update every 3 ticks client time, and I get 3 gamestates into the future (so I can simulate smooth movement). However it is jittery. I only check input every tick, so I don't think it's that.
[cpp] // Get user guess System.out.print("Please enter your guess, heads, or tails: "); String userGuess = input.next(); // Convert guess to 1 or 0 if (userGuess = "heads"); [/cpp] Hey guys, how would I go about making it so that when the user enters 'heads' he actually gives me a value of 1, and vice versa for tails?
[cpp] int userGuessInt; if (userGuess == "heads") { userGuessInt = 1; } else { userGuessInt = 0; } [/cpp] ? Unless I misunderstand what you are asking.
Or [code] int userGuessInt = userGuess == "heads";[/code]
[QUOTE=Rayjingstorm;35322844][cpp] int userGuessInt; if (userGuess == "heads") { userGuessInt = 1; } else { userGuessInt = 0; } [/cpp] ? Unless I misunderstand what you are asking.[/QUOTE] It's cool, I solved it, I didn't need to parse an integer from the string. Yet. [editline]28th March 2012[/editline] Thanks guys!
[QUOTE=Octave;35323286]Or [code] int userGuessInt = userGuess == "heads";[/code][/QUOTE] I need to look more critically at my code, I'm probably being overly verbose more often than I expect. Thanks for the fix :v:
So I need to manipulate a string in python as such [code] Wordone Wordtwo Wordthree wordfour Wordfive wordsix [/code] and have the output become [code] Wordone Wordtwo; Wordthree wordfour; wordfive wordsix; [/code] I can do the whole ; at the end part but strip('\t\n') only seems to remove a tab or \n if its at the beginning of a string and stops after the first word and begins at the second word. I'm not really sure what is causing this or if python just can't do this. Hopefully I said enough, I'm pretty new to python and still pretty new to the whole game, I know a decent amount of java but I've been diving into python lately.
[QUOTE=mutated;35212462]What's a good way to set up file structure in Java? I can create packages just fine, which organizes all my class files, but I'd prefer to split source files into folders so I can look at them much more easily - I have a lot of files and I intend to add more.[/QUOTE]
Sorry, you need to Log In to post a reply to this thread.