Previous Thread
Next Thread
Print Thread
Rate This Thread
Hop To
Page 3 of 10 1 2 3 4 5 9 10
#3663647 - 10/16/12 07:04 AM Re: Retro Flight Simulator: F-19 Game Design Document ***** [Re: mikew]  
Joined: Dec 2003
Posts: 12,488
MarkG Offline
Veteran
MarkG  Offline
Veteran

Joined: Dec 2003
Posts: 12,488
The Bayou
mikew, that pic is downright gorgeous! thumbsup

My path is going to cross with DID again, only next time I might actually know what I'm doing! smile


Originally Posted By: mikew
Keep up the good work with the C++. smile


It's my dream of a perfect retro flight sim that gives me the motivation I need to suffer through some of the boring and overbearing. Do I really need to learn the many rules and nuances of Polymorphism / virtual functions and operater overloading, just to port sample C++ code to BASIC? I doubt it but I really don't know so I plow through it all, it's the only safe bet.

I really don't care for C++ OOP, too much planning and overhead (class bases w/logical hierarchy, rights, constructors, prototypes). Individually no one feature is too difficult to understand, but mixed all together with nesting, pointers and what seems like a million rules and symbols (*,->,::) and it just becomes too much.

That's why BASIC was invented for people like me (who happens to like spaghetti). smile If encapsulation is suppose to help avoid spaghetti code, can a sub-standard C++ programmer still make a real mess of a program?

Inline advert (2nd and 3rd post)

#3663663 - 10/16/12 08:07 AM Re: Retro Flight Simulator: F-19 Game Design Document [Re: MarkG]  
Joined: Dec 2003
Posts: 12,488
MarkG Offline
Veteran
MarkG  Offline
Veteran

Joined: Dec 2003
Posts: 12,488
The Bayou
<Follow-up to last post...>

I appreciate Microsoft's continued support for VB6 through the lifetime of Windows 8...

http://vb6zone.blogspot.com/2011/09/vb6-on-windows-8.html
http://msdn.microsoft.com/en-us/vstudio/ms788708


And for CodeSmart keeping VB6 current and vibrant...
http://www.axtools.com/products-codesmart-vb6.php


Microsoft has recently made some interesting decisions (and reversals) regarding Visual Studio NET...

- Not long ago MS was promoting HTML5 and JavaScript for developing Win8 Metro apps, while not saying anything about VS.NET. Several months of panicking developers and finally MS spoke up. I thought it might be history repeating itself (VB6) but not this time, maybe they were testing the waters? Just give it time.

- VS2012's GUI is Metro (or whatever it's called now) ugly with a flat washed-out look that's very hard to see. MS added a color scheme fix after many complaints.

- It was announced that the free VS2012 Express versions would no longer be capable of creating desktop apps. MS reversed that decision after many complaints.

- VS2012 ships with a version of the NET framework which won't be supported by WinXP (NET 4.5). MS has NOT reversed this decision after many complaints. BTW, with VB6 I can write for Win95 - Win8, covering pretty much every Windows box out there! VS2012 can still write for XP, it's just that the program may not work properly (NET 4.5 updates and bug fixes are not available for XP).
++++++++++

Since VB6 supports the DirectX 7 SDK, I can make my in-house tools in VB6 with the same DirectX version as Blitz3D. Also, I can use VB6 as a front end to B3D for a more sophisticated GUI, works seamlessly.

It worked out good for me that I never went NET.



The rusty wire that holds the cork that keeps the anger in
Gives way and suddenly it’s day again
The sun is in the east
Even though the day is done
Two suns in the sunset, hmph
Could be the human race is run
#3663999 - 10/16/12 07:29 PM Re: Retro Flight Simulator: F-19 Game Design Document [Re: MarkG]  
Joined: Apr 2000
Posts: 1,123
Scott Elson Offline
Member
Scott Elson  Offline
Member

Joined: Apr 2000
Posts: 1,123
Hunt Valley, MD, USA
I thought you might find this amusing. While I had been interested in making games years before F-19 came out that was first game that I really wanted to get my hands on the code to make some changes. I could handle enemies just suddenly appearing but it drove me nuts that I'd be trying to get home with MiGs on my tail and would buzz one of our cruisers and they wouldn't do anything. I got so frustrated that I made a character Ben "D__ked" Arnold and went around destroying friend targets and I think I even was able to land at an enemy airbase. I really wanted a newspaper pop up about my defection. I got quite the negative score but it always reset to zero afterwards. I swore if I ever made a flight sim it wouldn't be "you against the world". I talked about this in an interview where they asked some sim developers what inspired them or something like that but I can't find the link anymore.

As for spaghetti code, planning and the such, while it's a pain I'd recommend avoiding spaghetti code as much as possible and at least getting a firm idea of how the different parts of the game are going to interact with each other. Even with good planning your codes going to get more complex over time as you need to make changes and add new previously unplanned features. Debugging code that's become a bunch of spaghetti just makes it that much harder.

I wouldn't worry too much about learning all the ins and outs of a language, at least initially and especially for what you're doing. Understanding that you can overload operators or other more complex operations is good to know in case you run into a situation where you might want to use it but until that time knowing the details on how to do it is just going to fill up your mental cache. I've only had to overload an operator a few times and usually I'll consult a book to make sure I'm doing it right but knowing it was an option did make those few situation easier.

We used C++ when we were doing the Jane's games but most of coded it more like C. I really didn't get the whole virtual function/inheritance thing myself. I wish I had though because, for example, there was a lot of that I would have shared between the ground vehicles and the planes. Instead I just copied the code and any time I made a change to one version I'd have to make a change to the other or bugs would show up. If I had done that I would have been able to make it so the planes, particularly the AC-130s could have used their guns against ground targets instead of running out of time.

Function-wise the shift from function based to object based coding wasn't that big of a deal. Most of our function were already things like "FlyPlane" where we'd pass in the plane we'd want to fly. So instead we'd just have plane->Fly().

The "ah ha" moment for me and virtual functions was when I was working on D&D Heroes and they were doing a lot more with these. This is one of those cases where having an understanding of what was going on under the hood made things easier. I'm going to go into detail here in case it might be of help. I will also note that this is how I think of it working and the actual details might be a bit different. Take a class. In it you have the data it needs and the functions it calls. Virtual function are stored in the class as a table where you have the name of the function and a pointer to where it is. Now you create a subclass. It's going to have a block of data that's everything contained in the parent class. If you look at it in a debugger you'll see the sub class but the parent class data will be in its own block within the subclass’s data that you'll need to expand to look at. This makes it easy to see that the parent’s data is still kept as its own thing. This makes it so if you call something that takes the parent class as an argument that it will just pass that self-contained block of data. This subclass also has its own function table but I don't think it's partitioned like the data. So, if you have a virtual function that overrides the parent class it just replaces name/pointer pairing to use the new function. You can still get access to the original classes function which can be very useful.

For example, let's say you have a "Plane" class. In the tick function you have calls to move the plane, AI logic and other such things. Well the base plane might be considered a "civilian" plane. The basic flying and control code will probably work for all planes, though they'll have different values for "top speed", "roll rate" and such. For the AI you could do have a “Think” function. The base version could be for everyday flying, following waypoints and such and possibly some base defensive logic. For a fighter logic you could add looking for targets (though then might be in a situational awareness function instead) and flighting code but if none of that was going on just call the base function.

Now you could do this in C. In the tick function you could have a case statement or an if/else section which could get pretty big. Something like:

if(plane.type == bomber)
{
DoBomberLogic(plane);
}
else If(plane.type == fighter)
{
DoFighterLogic(plane);
}
else
{
DoCivilianLogic(plane);
}

And both DoFigherLogic and DoBomberLogic could call DoCivilianLogic if nothing was going on. Still, let’s say that you wanted to add a function of DoEnemyFighterLogic. In C++ you could just create an EnemyFighterPlane class that derived off of the Plane class or more likely the FighterPlane class. You’d create any virtual function that needed creating and you were done. If you were doing it in C you’d still have to create those new function and probably have to search on every instance of “type == fighter” to see where you might need to hook things in. You can also run into some rather large case or if/else statements as you discover new types you need to add.

Another problem is that if you want to use the plane class for all planes then every plane is going to use the same structure. This means that even a civilian aircraft is going to need all the data allocations that a fighter would need. Also, let’s say that you wanted to add a helicopter at some point, this can then open up a whole new can of worms. Trust me, I speak from experience. As I said, we didn’t really take advantage of all C++ had to offer and I had to do some interesting stuff to add in helos and Harriers.

Of course trying to do stuff in a new language can have its own growing pains so that need to be factored in as well. I’ve had to work with a bunch of different languages over the years. There were times I would have preferred to have stuck with a language I knew better but there were reasons for the shift. That’s a good part of why I focus on learning what I think I need as opposed to learning all the details. I’ve learned a lot of stuff that I can’t use anymore. Right now I’m working in C# and since it has its own memory management a lot of debugging tricks I used to do which depended on data staying at the same memory address don’t work anymore. I’m actually having to use tricks from back when you didn’t really have a debugger, just a compiler. Still not learning/worrying about all the details has caused me to miss out on some job opportunities when interviewers have asked questions about stuff, like definitions, you only really need to know in college. And, as I said earlier, there were the things I learned which would have made things easier if I had known them earlier. Trying to keep track of all the details can be overwhelming but being aware of what a language can allow you to do can sometimes make things easier. In this case forums can be your friend. If you run into something that's going to be a pain you can probably find some people with suggestions.

Oh and you can definitely still make a mess in C++.

Hopefully this was of some interest though I fear I’m probably being as clear as mud.

Elf




Last edited by Scott Elson; 10/17/12 02:43 AM. Reason: Fixed a typo and maybe formatting issue.
#3664004 - 10/16/12 07:42 PM Re: Retro Flight Simulator: F-19 Game Design Document [Re: MarkG]  
Joined: Jan 2001
Posts: 24,314
BeachAV8R Offline
Lifer
BeachAV8R  Offline
Lifer

Joined: Jan 2001
Posts: 24,314
KCLT
I have no idea what 80% of that meant..but it was interesting to read the thought process about how you approached game design and what, as a developer, you wanted to do.

Much appreciated insight!

BeachAV8R

* And F-19 was one of my favorites. I remember trying to keep that little ECM/Stealth bar as low as possible all mission.. biggrin



#3664282 - 10/17/12 06:14 AM Re: Retro Flight Simulator: F-19 Game Design Document [Re: MarkG]  
Joined: Dec 2003
Posts: 12,488
MarkG Offline
Veteran
MarkG  Offline
Veteran

Joined: Dec 2003
Posts: 12,488
The Bayou
Scott, I was hoping one day you'd show up on this thread! Thank you for giving examples of procedural vs. OOP in a combat flight sim, that's a rare read. And I'm sure everyone agrees that it's an absolute treat when we get details about the development of classic flight sims.

I occasionally check the Kindle store and Amazon hoping that one day a flight sim developer will write a book on their experience. I've purchased several similar type Kindle books but none can be found specific to flight sims, I keep waiting.

BTW, it was only recently that I noticed the F-117A credits include some of the same names as Janes F-15 (i.e. Andy Hollis, Greg Kreafle, Max Remington, David McKibbin, Todd Brizzi).

++++++++++

You may have noticed I'm using a very old "batteries included" 3D game creator called Blitz3D (BlitzBasic + DirectX 7). It's actually still being sold and maintained because it's still being used for quick prototyping, I'm using it to learn how to create a 3D game (which is still not easy even in BASIC).

Not OOP though, only ways to mimic...
Applied Object-Based Programming with Blitz3D (PDF)

This is all it takes to show a primitive in 3D:

==========
Graphics3D 800,600,32,0
SetBuffer BackBuffer()

camera=CreateCamera()
light=CreateLight()

cone=CreateCone( 32 )
PositionEntity cone,0,0,5

While Not KeyDown( 1 )
RenderWorld
Flip
Wend

End
==========

Gotta start somewhere but it won't be with C/C++ (other than porting code). BlitzBasic makes initializing 3D graphics about as easy as VB6 makes displaying a new window, something I don't bother with in VC++6. Even with the MFC Wizard it's too many steps, I can't imagine what it takes to code it manually. First thing I do in VC++6 is include the iostream header and then use cin/cout with the console.

I'd have no problem overloading my own functions but not the built-in operators, just doesn't seem like a good idea to me. And that's one thing I don't like about C, it seems like everything is defined by context (and that's before any overloading)! On a similar note, what trips me up the most (and no it's not = vs. ==, that one is constantly harped on) is working with tutorials where pointers aren't labeled properly and I confuse them with regular variables.

Again, thank you very much for your post. I followed along pretty well except vtables are a bit over my head right now. smile

#3664284 - 10/17/12 06:34 AM Re: Retro Flight Simulator: F-19 Game Design Document [Re: BeachAV8R]  
Joined: Dec 2003
Posts: 12,488
MarkG Offline
Veteran
MarkG  Offline
Veteran

Joined: Dec 2003
Posts: 12,488
The Bayou
Originally Posted By: BeachAV8R
I have no idea what 80% of that meant..


Whenever I feel like I'm finally getting it I just pull up the Falcon source in VC++6. Other than some recognizable scattered syntax, total Greek. May as well be ~10,000 pages of Klingon. The EECH source (plain C, I think) is a little better.



The rusty wire that holds the cork that keeps the anger in
Gives way and suddenly it’s day again
The sun is in the east
Even though the day is done
Two suns in the sunset, hmph
Could be the human race is run
#3664288 - 10/17/12 07:06 AM Re: Retro Flight Simulator: F-19 Game Design Document [Re: MarkG]  
Joined: Dec 2003
Posts: 12,488
MarkG Offline
Veteran
MarkG  Offline
Veteran

Joined: Dec 2003
Posts: 12,488
The Bayou
I should [clarify] something, I would never port copyrighted material without permission (EECH).

I have plenty of simpler examples to port (or at least to reference) like those found in the DOS-based Build Your Own Flight Sim...




I use the REAL flight sims only as a reminder as to why I should keep it as simple and easy to develop as possible. A reality check, I guess.

#3664295 - 10/17/12 07:27 AM Re: Retro Flight Simulator: F-19 Game Design Document [Re: MarkG]  
Joined: Feb 2001
Posts: 2,829
mikew Offline
Senior Member
mikew  Offline
Senior Member

Joined: Feb 2001
Posts: 2,829
UK
You're getting sidetracked again. wink

This thread is called "Retro Flight Simulator: F-19 Game Design Document", and that's what I want to see. smile

Design the game first, then worry about how you are going to implement it.

#3664469 - 10/17/12 02:37 PM Re: Retro Flight Simulator: F-19 Game Design Document [Re: MarkG]  
Joined: Dec 2003
Posts: 12,488
MarkG Offline
Veteran
MarkG  Offline
Veteran

Joined: Dec 2003
Posts: 12,488
The Bayou
LOL. wink

Unfortunately for the self-taught and inexperienced game developer, the design is dictated by the implementation. That is, the design is limited to the capabilities of the decade old tools the developer has chosen for their accessibility.

In regards to being sidetracked, what's required the most discipline is putting the game aside long enough to complete some programming and high school math textbooks. But I'm almost done with the books and then we're going to have a whole heap (pun intended) of fun!

explode

++++++++++

You know, I never did finish my document, I see nothing about air-to-air.

I'll at least summarize my idea for now:

Air-to-air is kinda silly in F-19, although F-117A fixed this with the "realistic" Lockheed option (nighttime only, no air-to-air, etc.). I'm initially going down that path, if anything just to keep my scope smaller. But what would an F-19 sim be without the ability to fly the mission in Red Storm Rising?

The answer could be the successfully tested anti-AWACS Hughes Brazo air-to-air HARM missile:
http://en.wikipedia.org/wiki/Hughes_Brazo

At least have specialized anti-AWACS capability. I dunno, maybe optional Sidewinders attached to the bay doors ala the F-35?

There was some other stuff too, I'll have to dig through my notes.

Oh yeah, some things in F-19/F-117A should be made easier IMO with at least an option (i.e. auto-open/close bay doors on pickle ala TAW). Also, I want to have the ability to fly with a mouse or keyboard, I don't usually carry a joystick around with my laptop. F-29 Retaliator is a rare example of flying with a mouse while keeping good control.


EDIT: Scott, you're dead-on about friendly defenses not helping you, this also griped me sometimes with TAW. But in TAW I could at least land (or eject) then jump in an AWACS and vector a can a woop-ass to my pursuers. At the very least the enemy AI should drop the pursuit and turn away before reaching a friendly cruiser or SAM site.

Last edited by MarkG; 10/17/12 02:52 PM.
#3664704 - 10/17/12 09:29 PM Re: Retro Flight Simulator: F-19 Game Design Document [Re: MarkG]  
Joined: Feb 2001
Posts: 2,829
mikew Offline
Senior Member
mikew  Offline
Senior Member

Joined: Feb 2001
Posts: 2,829
UK
The point of doing the game design first is that you can break the task down into smaller chunks, then start implementing those chunks in VB6. In fact, the only thing that VB6 will struggle with is the 3D world, but BlitzBasic will be good enough to see whether your game 'works' or not.

It's your gig though. smile

ps What's the ISBN number for that 'Build your own Flight Sim in C++' book?

#3664728 - 10/17/12 09:59 PM Re: Retro Flight Simulator: F-19 Game Design Document [Re: MarkG]  
Joined: Dec 2003
Posts: 12,488
MarkG Offline
Veteran
MarkG  Offline
Veteran

Joined: Dec 2003
Posts: 12,488
The Bayou
Scott's right, I'm drowning in the details. I can look at relatively simple C++ code and follow it just fine, should be all I need and I can look up the rest as I go. (And C has no built-in string "data type", I said it wrong with "variable".)

I finished Algebra 1 and I'm almost halfway through Geometry, probably already know more than enough math to get started. I'll be using an add-on physics engine, not sure if I'll ever be capable of writing my own (needs to be a C .DLL). I'm going to keep doing my one math lesson a day regardless (Trig is next, then Calculus), so maybe one day.

3D modeling is my next really big learning adventure (but remember, low-res polys and textures). AutoCAD will be useful for creating detailed uniform plan and isometric views for each model (and you can import scans), but probabley not for full modeling, at least not the old version I use (2000).

For 3D modeling I'll be using DeleD...
http://delgine.com/

It's free and has very good support for Blitz3D. This can always change, of course. But DeleD is suppose to be very easy to learn and use, exactly what I need.

++++++++++

So here's the plan...

I'm taking the next two weeks to wrap up the book learning/tutorials and on Nov. 1 I'm going to start real development on this sim. I figure I'll start with the game loop, an empty map representing the North Cape and a simple flight model to fly around it (full-screen camera until we have a pit and exterior model).

Now we're not going to have moving clouds, animated lightning/thunder nor rain/snow modeling for some time, but you are not going to BELIEVE how easy this is to do in Blitz3D (easy being relative, of course)! I know this because it's all included in the samples. Even the northern lights are possible (an edit on lightning).

So...in two weeks we get started (that's a literal 14 days...rather 15).

+++++++++

Scott said, "If you were doing it in C[++] you'd still have to...". I knew what you meant before you corrected it. smile Just to let you know I'm paying attention, and please feel free to elaborate on your flight sim development experiences anytime.

#3664745 - 10/17/12 10:26 PM Re: Retro Flight Simulator: F-19 Game Design Document [Re: mikew]  
Joined: Dec 2003
Posts: 12,488
MarkG Offline
Veteran
MarkG  Offline
Veteran

Joined: Dec 2003
Posts: 12,488
The Bayou
Originally Posted By: mikew
The point of doing the game design first is that you can break the task down into smaller chunks, then start implementing those chunks in VB6. In fact, the only thing that VB6 will struggle with is the 3D world, but BlitzBasic will be good enough to see whether your game 'works' or not.

It's your gig though. smile


I have a VB6 3D game somewhere (some kind of Mario looking racing game) and it actually works pretty good, except maybe being a little sluggish on my older laptop.

I was only going to use VB6 for the front-end GUI (also in the samples) instead of Sprite Candy, which is a large BlitzBasic source library for making GUIs in 3D graphics (among other things and man is it smooth!). Are you suggesting the entire game could be written in VB6?

I tell you what, I've run my VB6 apps under Linux Wine and although I imagine it would drag 3D game graphics way down, I would give up textures all together to get off Windows! I'm sure I'm misunderstanding you, but that's intriguing. Blitz3D will not run under Linux AFAIK (unfortunately), I assumed DirectX 7 was the culprit (which would be the same for VB6, unless using DX8). I never got TAW to work either.


Originally Posted By: mikew
ps What's the ISBN number for that 'Build your own Flight Sim in C++' book?


ISBN-10: 1571690220
ISBN-13: 978-1571690227

Build Your Own Flight Sim in C++

Last edited by MarkG; 10/17/12 10:38 PM. Reason: fixed link


The rusty wire that holds the cork that keeps the anger in
Gives way and suddenly it’s day again
The sun is in the east
Even though the day is done
Two suns in the sunset, hmph
Could be the human race is run
#3664761 - 10/17/12 10:59 PM Re: Retro Flight Simulator: F-19 Game Design Document [Re: MarkG]  
Joined: Feb 2001
Posts: 2,829
mikew Offline
Senior Member
mikew  Offline
Senior Member

Joined: Feb 2001
Posts: 2,829
UK
Thanks for the ISBN and link. I won't go out of my way to get it, but if it turns up locally I'll try and pick it up. There's a lot of wisdom from those days which is all but forgotten in this era of bloat.

Originally Posted By: MarkG

Are you suggesting the entire game could be written in VB6?
Yes!

I reckon you could easily (in processing terms) replicate a TAW AWACS mission in VB6 (minus the little 3D window). For 3D stuff, you'd probably need to do something like the things described here:
http://vbgamer.com/DirectX4VB/TUT_DX7Start.asp

#3664768 - 10/17/12 11:12 PM Re: Retro Flight Simulator: F-19 Game Design Document [Re: MarkG]  
Joined: Dec 2003
Posts: 12,488
MarkG Offline
Veteran
MarkG  Offline
Veteran

Joined: Dec 2003
Posts: 12,488
The Bayou
Please excuse my knee-jerk reaction, the VB6 IDE would also have to work under Linux. I was thinking more about if I need to buy a new PC or laptop in the future (I know it wouldn't run Win2000, maybe not XP either).

mikew, I think I needed my own gig for motivation because I'm no genius and none of this comes easy to me. Most real game developers have college degrees and I barely passed high school. But I know exactly what I want...

When this gets started I think it's going to go pretty quick.



The rusty wire that holds the cork that keeps the anger in
Gives way and suddenly it’s day again
The sun is in the east
Even though the day is done
Two suns in the sunset, hmph
Could be the human race is run
#3664789 - 10/17/12 11:44 PM Re: Retro Flight Simulator: F-19 Game Design Document [Re: MarkG]  
Joined: Feb 2001
Posts: 2,829
mikew Offline
Senior Member
mikew  Offline
Senior Member

Joined: Feb 2001
Posts: 2,829
UK
There's nothing more to programming than being able to count up to 1 lots of times, so you'll be fine. Besides, I've seen the quality of your VB6 work. thumbsup

I tend not to mix my Linux and Windows worlds, and only use Windows machines for gaming.
If I was forced to use only one machine, I'd have Linux as the base OS, then use VirtualBox to install any variant of Windows.

#3664802 - 10/17/12 11:54 PM Re: Retro Flight Simulator: F-19 Game Design Document [Re: mikew]  
Joined: Dec 2003
Posts: 12,488
MarkG Offline
Veteran
MarkG  Offline
Veteran

Joined: Dec 2003
Posts: 12,488
The Bayou
Originally Posted By: mikew
I reckon you could easily (in processing terms) replicate a TAW AWACS mission in VB6 (minus the little 3D window). For 3D stuff, you'd probably need to do something like the things described here:
http://vbgamer.com/DirectX4VB/TUT_DX7Start.asp


Oh this is good!

Believe it or not it's taken learning C++ to really start understanding VB6. Not because VB was developed in C++ but because VB books normally don't explain passing arguments By-ref (using a pointer) vs. By-val (making a copy, staying local), or why it even matters with large variables (efficiency vs. safety). The instruction cache, the stack, FIFO, you learn about this stuff in C++ for Dummies but not in most VB6 books.

Heck, there's parts of the VB6 IDE I'm just now discovering how to use, along with more comprehensive techniques (nested types, multi-dimensional and dynamic arrays, random access files, ActiveX). ~20 years of VB classic and I'm just now learning to program. smile

I like where this is going.



The rusty wire that holds the cork that keeps the anger in
Gives way and suddenly it’s day again
The sun is in the east
Even though the day is done
Two suns in the sunset, hmph
Could be the human race is run
#3664821 - 10/18/12 12:35 AM Re: Retro Flight Simulator: F-19 Game Design Document [Re: MarkG]  
Joined: Feb 2001
Posts: 2,829
mikew Offline
Senior Member
mikew  Offline
Senior Member

Joined: Feb 2001
Posts: 2,829
UK
It's late here, so one question about VB6 before I crash out:
Can you, given you know what parameters to expect, interact with a DLL written in C++?
I know this isn't a particularly 'safe' way of computing..but it's the shortcut to amazing things. smile

#3664835 - 10/18/12 01:13 AM Re: Retro Flight Simulator: F-19 Game Design Document [Re: MarkG]  
Joined: Dec 2003
Posts: 12,488
MarkG Offline
Veteran
MarkG  Offline
Veteran

Joined: Dec 2003
Posts: 12,488
The Bayou
Absolutely! You just Declare it [EDIT: w/ function name] and it's like it was written in your program. Safe? Yeah, I believe you just have to make sure your argument types match. I just read up on this recently, I'll have to revisit it. But it'll work.

Another benefit of C++ is learning a better way of code organization which applies even to VB6 (surprised me, VB has classes although not exactly the same but with similar concepts).

A discussion on Polymorphism in VB6, couldn't quickly find a better link...
http://www.techrepublic.com/forum/discussions/87-191763

I understand C++ better in this case, I'll have to chew on this one.

I'm off to buy printer cartridges, the DirectX7 SDK has lots of help for VB6.

Last edited by MarkG; 10/18/12 01:17 AM.
#3664930 - 10/18/12 05:30 AM Re: Retro Flight Simulator: F-19 Game Design Document [Re: MarkG]  
Joined: Dec 2003
Posts: 12,488
MarkG Offline
Veteran
MarkG  Offline
Veteran

Joined: Dec 2003
Posts: 12,488
The Bayou
<Comes back with clearer head>

I was confused with the difference between Blitz3D and VB6 w/DX7 SDK, until I compared tutorials. Whoa, now I get it.

I'll get started with the game on the 1st as planned, knowing one day I may not need Blitz for 3D. Like you suggested, I can take it a piece at a time.

A 2D AWACS or campaign plug-in would be a nice VB6 project, B3D and VB can even share DLL functions. B3D can even use an ActiveX DLL written in VB6 but it needs a 3rd-party add-on which is no longer available (which I believe was buggy anyway).

#3665111 - 10/18/12 01:56 PM Re: Retro Flight Simulator: F-19 Game Design Document [Re: MarkG]  
Joined: Dec 2003
Posts: 12,488
MarkG Offline
Veteran
MarkG  Offline
Veteran

Joined: Dec 2003
Posts: 12,488
The Bayou
Computer Science 101, Today's Assignment:

1. Write a simple function in C++ to return the factorial of a number using recursion.
2. Compile to DLL.
3. Link DLL w/VB6.
4. On a VB6 form add a textbox, button and label.
5. User enters number and presses button, factorial is returned.
6. Repeat function in native VB6 for speed comparison (larger numbers should grind).

Stay tuned...



The rusty wire that holds the cork that keeps the anger in
Gives way and suddenly it’s day again
The sun is in the east
Even though the day is done
Two suns in the sunset, hmph
Could be the human race is run
Page 3 of 10 1 2 3 4 5 9 10

Moderated by  RacerGT 

Quick Search
Recent Articles
Support SimHQ

If you shop on Amazon use this Amazon link to support SimHQ
.
Social


Recent Topics
Anyone can tell me what this is?
by NoFlyBoy. 04/16/24 04:10 PM
10 Years ago MV Sewol
by wormfood. 04/15/24 08:25 PM
Pride Of Jenni race win
by NoFlyBoy. 04/15/24 12:22 AM
It's Friday: grown up humor for the weekend.
by NoFlyBoy. 04/12/24 01:41 PM
OJ Simpson Dead at 76
by bones. 04/11/24 03:02 PM
They wokefied tomb raider !!
by Blade_RJ. 04/10/24 03:09 PM
Good F-35 Podcast
by RossUK. 04/08/24 09:02 AM
Gleda Estes
by Tarnsman. 04/06/24 06:22 PM
Copyright 1997-2016, SimHQ Inc. All Rights Reserved.

Powered by UBB.threads™ PHP Forum Software 7.6.0