Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 16 Oct 2013
Offline Last Active Today, 01:20 PM

#5190238 Match-3 Program Question

Posted by Lactose! on 30 October 2014 - 04:03 PM

the programmer seems to think there should be a more efficient way to detect matches.

Most likely, this is true.

Most likely, this does not matter at all.


Unless there are cases which the code does not handle correctly, or if the code's efficiency is a real (measurable) problem, notions like "it can be done better" should be filed away for the sequel. Your goal is to finish and ship the game, not to rewrite pieces of code until the end of time.


As is often the case, perfect is the enemy of good [enough].


EDIT: If there are real problems (measurable or use cases where it fails), posting details on those specific areas would be required for further feedback.

EDIT 2: Ninja skills are definitely improving today.

#5190207 Match-3 Program Question

Posted by Lactose! on 30 October 2014 - 02:27 PM

You say you've already got a demo up and running. I would assume this includes some sort of code for checking matches.

Is the code you have already not good enough? If not, why not?


If you don't have any code for checking matches yet, what have you tried?


It's somewhat tricky to give specifics without more details (especially if you have something working but it's not good enough for you, for some reason), but more advice should be possible, especially given the answers to those questions.

#5190096 Creating a Grand Theft Auto type of Game in Delphi.

Posted by Lactose! on 30 October 2014 - 02:46 AM

OpenGL is the engine I usually use.

OpenGL is still not a game engine (as I mentioned the last time you referred to it as such). It is still a cross-language, multi-platform rendering API (specification).

"Game engine" in the context of the original post is a term used mainly for more complete packages, usually something like Unity3D, Unreal Engine, etc. It can also refer to the parts of a studio's code base that are reused for multiple games.

#5190011 Game Development with Delphi: "Yes or No?"

Posted by Lactose! on 29 October 2014 - 02:36 PM

Another Delphi post/thread?


If the best thing about Delphi is "you can create the same games as when using other languages, but it might be a lot harder and take a lot more time", then I would find it foolish to choose it over other, more pragmatic solutions. The exception would be if one wanted to do so for learning purposes or because one found it fun/interesting or similar.


If I had a project in mind*, I would want to choose a language/framework/engine that I thought best suited the project/goal. As someone who has never used Delphi, I don't see any particular reasons why I would want to change that, aside from the catch-all notion that being knowing multiple languages is usually a boon.


If I were a Delphi expert, I would probably be more inclined to choose Delphi, assuming no other languages/frameworks/engines were better suited, given my other knowledge in this hypothetical scenario. That said, I personally see no reason for choosing learning Delphi as opposed to e.g. C# or Python.


That's not to say Delphi users can't or don't create awesome things. I'm sure they can and do, but for me personally to be interested, there would have to be a clear benefit to it, which isn't something that you've conveyed so far in any of the posts/threads I've seen you make.



*And I do. I don't see a reason why I should use Delphi for it, so I won't.

#5189918 Wanted: Free 3D Game Engine for Farming Game

Posted by Lactose! on 29 October 2014 - 07:26 AM

Here is a few Game engines in Delphi:

XNA is usually considered to be a framework, not a game engine.

OpenGL is not a game engine. It is a cross-language, multi-platform rendering API (specification).

#5189650 function that returns class template

Posted by Lactose! on 28 October 2014 - 04:06 AM

Don't use underscores as a suffix. 

Using underscores as a suffix is ok, as long you avoid adjacent underscores.

What WiredCat is doing is using them as a prefix, which you shouldn't (as per ChaosEngine's quote).


Suffix = at the end.

Prefix = at the beginning.

#5188927 how to limit fps in glut ?

Posted by Lactose! on 24 October 2014 - 09:51 AM

Minimal effort question = minimal effort answer.


#5184255 how does it make the game?

Posted by Lactose! on 01 October 2014 - 02:52 AM


#5181622 Can you explain to me this code !

Posted by Lactose! on 19 September 2014 - 03:07 PM

If you enter 100, you will get to how_much = int(choice).

That means how_much is equal to 100.

In the next if statement, we check if how_much is less than 50. 100 is NOT less than 50, so we do not enter the if part of the if statment.

Instead, we enter the else part of the if statement.

Inside the "else" part the dead("You greedy bastard!") code run.

The dead code will print the text you see.




Like I've done before, I would suggest you slow down. You seem to be going too fast. You might be going through the exercises quickly, but if you don't understand them, you won't learn much.

The questions you're asking indicate you're missing some fundamental knowledge. I would urge you to back to earlier lessons, and not progress until you feel you understand basically every line in the lessons you're working on. If parts are unclear, I'm sure people will help you. That said, I would recommend you ask more specific questions.

Instead of "help what does this do" and post all the code for a lesson.

#5181150 Tilemap collision problem

Posted by Lactose! on 17 September 2014 - 04:43 PM

It will probably not move because it's stuck inside the collision.


One solution could be:

1. Store current player position.

2. Update the player position.

3. Check the new position for collisions.

4. If a collision was detected, move back to the original position (stored in step 1).

#5176024 Missile Command code review request

Posted by Lactose! on 25 August 2014 - 11:06 AM

I'm using Visual Studio, as far as I can tell it only compiles the files that have been edited, and if I'm not mistaken, I believe that it doesn't compile files just because they were included by another. Or, I could be totally wrong about that...

You can think of #include as basically copying the included file into the current file.


If "A.cpp" has #include "B.h", and something inside "B.h" changes, "A.cpp" will need to recompile.

#5175801 where to start...

Posted by Lactose! on 24 August 2014 - 07:44 AM

Have you checked out the FAQ? It contains a lot of good information when you're just starting out.


I wouldn't worry too much about learning "the wrong thing" -- almost everything you can learn is something you can benefit from, in some way or another.

#5175627 Game Designer vs Team Arguments

Posted by Lactose! on 23 August 2014 - 07:22 AM

A better word to use might be "discuss". To me "argue" is more hostile and more about trying to convince the other person, while "discuss" is more aimed towards finding a solution.


Regardless, having more eyes and thoughts on a subject can be a good thing. It can help you spot flaws you wouldn't have thought of yourself, and it can spark even better ideas.

#5175623 Increment Frame Bug

Posted by Lactose! on 23 August 2014 - 06:30 AM

As I mentioned in one of your previous threads, the point of using CurrentFrame = SDL_GetTicks() / 200 % 3 (or other values instead of 3) was a way to quickly/with a low amount of changes be able to help verify what was causing a bug you were having earlier. It was not suggested as a fix (explicitly so), because of various reaons, some of which have been pointed out by L. Spiro.


Your current problem might be caused by the contents of DownAttackTex -- we never see how this is created/filled. Possibly there's some uninitialized data here, or maybe you're accessing something out of bounds of the array.

I'd recommend setting a breakpoint at the function which makes the game crash, and look at what each variable in the function call evaluates to. This should hopefully help locate the problem.


That said, I'd like to reiterate both L. Spiro's and my own earlier comment. Once you've fixed this problem, you should take a closer look at how you're structuring and doing your sprites/animations. You're still fairly early in the process, which means fixing it and having a more solid foundation to work on will be very valuable and time-saving going forward.

#5175437 DeltaTime and acceleration

Posted by Lactose! on 22 August 2014 - 03:35 AM

Had you used correct formula you'd have identical result.

You've got a typo, 5.5 should be 4.5.


Apart from that, one of the reasons you (panicq) should use a fixed timestep is related to collision checking/handling. You can actually see it from Zaoshi Kaba's example; what if there's something you'd collide with at x = 4.5 (after 3 seconds), but which you would NOT collide with at x = 8 (after 4 seconds)?

How would you solve this issue? Now imagine having to deal with/special case all other issues like this. OR you could fix your timestep (a 1 time thing), and have the results deterministic regardless of what framerate the game is running at.


Note that even though the logical simulation (handing movement, collision, etc.) should have a fixed timestep, the render part does not need to have a fixed timestep. If you wanted (for some reason), you could force rendering to occur every 3 seconds, without impacting any of the logical/gameplay stuff.


Can you give an example of why a game would not want to have a fixed timestep? You claim this is the case for many games, but I can't think of a single game for which this is true.