Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3965862
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T03:31:20+00:00 2026-05-20T03:31:20+00:00

I almost finished writing the first draft of my game’s logic engine which is

  • 0

I almost finished writing the first draft of my game’s logic engine which is entity / component based. It’s not perfectly based on that philosophy, but I also think that how the implementation is done differs from person to person. I’m writing in C++ using OOP, STL and virtual functions. Yes, I know that virtual functions may be slow but it’s not an exercise for doing something very fast, just a logic engine which can be easily extended and easily understood by others (everything is also commented). It’s just an exercise of ‘software design’ by a newbie to game developing if you may wish to call it that way.

My first draft is almost complete, the core services (various inits, directX, etc) are separated from the game logic and are ready to be used. I’m just trying to finish the logic engine before I can make my first prototype game (I think about an isometric ARPG). The GL engine is built like a tree of classes, starting at the top with the basic abstract class “Entity” and deriving from it more and more specific classes. There are no more than 3 or 4 levels of inheritance anywhere for good design reasons.. I think.

But I may have a serious problem: in certain classes in which I declare as member variables objects of another class, this happens: after the IDE kicks in and analyzes what I’ve written, it underlines those specific member variable’s type (the class name) and it says it isn’t declared anywhere. Then after a split of a second, the red underline disappears and it says it’s ok and declared (o.O) IT HAPPENS AGAIN AND AGAIN everytime it analyses the code. This happens also in another class with another type of class. Just to be clear, I did include all the relevant headers and it SHOULD know about the type’s declaration and where is it done.

Also, if I try to compile, it gives me gl_nonrenderableentity.h(21): error C2143: syntax error : missing ';' before '*' and gl_nonrenderableentity.h(21): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int in pairs for each offending variable.

I know that the cause of this is not finding it’s type anywhere (which strangely, the IDE finds, almost a second after each analysis). Sometimes those errors would be duplicated in the compiler’s output and after tweaking a little how the headers where included, I get only one copy per variable (and it still doesn’t makes sense, I’m using include guards.. doesn’t VS 2010 Express understand pragmas ?)

I think it may be a header problem, but the most intriguing thing for me is: why the hell the IDE underlines the variable’s type with red, saying it can’t find it and after a second or two it finds it, no more problem, but when I compile all the project it gives me the former mentioned errors above.

Every time I had a problem, I researched and found a fix on my own, even problems with the IDE (the famous msbuild bug). But I just can’t figure this out and I need the help of the veterans. Anyone has a clue of why the IDE is reacting like that ? The disappearing red underline after each analysis of the IDE must mean something. I know this happens with new variables when you write until the IDE finds their declarations, but it’s only once and then it’s ok no matter what.. with those 2 specific classes, it always does again and again this (and those are the only ones having this problem). Other member variables from other classes don’t have this problem.

Thank you. Sorry for the long post, but I’ve tried making myself clear as hard as I could. If anyone wants any more information, please..

SOLVED

It was a circular reference problem, just use a forward declaration and you’re fine.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T03:31:20+00:00Added an answer on May 20, 2026 at 3:31 am

    The only reason I can think of is a circular reference, and even though it may not be immediately evident, a simple way to check (and possibly fix) this is to add a forward declaration for the other class:

    class NonRenderableEntity;
    
    class Action:public NonRenderableObject
    {
        ...
        NonRenderableEntity *userEntity;
        ...
    };
    

    Also, don’t take the IntelliSense checking (red underlines) too seriously — it’s not perfect and can get confused, especially with complex references such as this.

    Update: Circular references won’t cause a problem as long as you only use pointers to objects. Because a pointer’s size is independent of the actual object, the compiler can allocate a pointer beforehand without problems. In languages such as C#, objects are always manipulated via references (pointers) so this problem doesn’t surface.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm almost finished with the book Head First Java. The reason I'm studying this
Almost every Java book I read talks about using the interface as a way
Almost 5 years ago Joel Spolsky wrote this article, The Absolute Minimum Every Software
Almost every Python web framework has a simple server that runs a wsgi application
Almost every new Java-web-project is using a modern MVC-framework such as Struts or Spring
( Almost exact duplicate of Keeping original format POST passing through AWK submitted by
In almost all projects, the choice of the database system is 'almost' automatic ..
I almost feel embarrassed to ask, but I always struggle with how to organize
In almost any Windows application, I notice that holding the mouse button down in
Like almost anyone who's been programming for a while, I'm familiar with the term

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.