[Question] Creating a Game - No Template

Cryptonomic Kind of a long post here so hopefully some of the experts will bear with me and help me see where I am going wrong. (This might help others who approach SCI Studio the same way I did.)

In SCI Studio 3, I create a new game based on an empty game. Since this feature is able to be used, I choose to use it. I copy the main SCI interpreter files into my game directory. (These files are: std.drv, adl.drv, sciv.exe, joystick.drv, ibmkbd.drv, gm.drv, and ega320.drv.)

Now, in order to even compile a script I need a vocab.000. So I open up the Vocabulary Editor from the main toolbar. I then create a simple group just to get things going. I do a "Save As" to my game directory as Vocab.000. Now, it appears you cannot just add this to your game because there is no resource file yet. However, if I hit the Rebuild button that creates resmap.tmp and resource.001. This then does allow me to use the "Save to Game" menu item on the Vocabulary Editor and this does seem to work in terms of putting Vocab.000 into my game. I then Rebuild again as this seems to be necessary.

Now I am also told in the Help documentation that the game must have a script.000 and that bare minimum to go in this file is:

(script 0)

(class Game
(method (play)
// Put code here
)
)

(instance GameInstance of Game)

So I open the Script Editor and put the above in the script. I have to save the script as Main.sc let us say. Then I compile it to Main.sco. But I cannot add Main.sco to the Resources. When I try to do I get:

"The file you are trying to add, C:\BrandNew\Main.sco, is not a valid SCI resource, or does not contain a valid header."

So I add to my Main.sc file:

(include "sci.sh")

and that seems to work. When I add this line, it automatically adds Main to my game (as Script.000) but when I try to double-click on Main I get the message:

"Sorry, scripts can not be edited, only created. You can create them with the script compiler."

Now I realize you cannot edit scripts if the .sc file is not present. But in this case I have the Main.sc and Main.sco in the same directory in my game directory, just like in the template game. (And according to the Help file, that bare minimum quoted above is all I need for SCI0 to execute a game.)

Also if you Rebuild anytime after this you get the error message:

"Resource package/map file identifier mismatch! The game you are trying to open is incomplete, corrupt, or not the correct version."

Then you get the message:

"An extremely odd error occurred that should'nt have. Go figure. The game will now be closed."

This seems to not just close the game, but forces you to End Task the whole SCI Studio via the Task Manager in Windows 2000.

This was a lot to wade through so I appreciate those that took the time. Now I realize people will say: just use the template. I can do that. But obviously the choice is in there to create a game from scratch. Creating a game from scratch can be a good exercise for you to try if you want to learn how to build a game from the ground up. Plus it will make you very cognizant of how all the resources all link together, which can generally give you a great deal of insight into the overall structure of SCI. This is the case in any development language. [B]So the real question, given my steps that I have provided, is what am I doing wrong?[/B] I realize doing a game without the template is not the best way, but for learning purposes, I am still curious about "from the ground up development".

(I think part of the problem may be how I am creating the Resource.001 file. I just create it, by proxy, by hitting the Rebuild and it seems if you do that often enough, when creating your own game, you cause that resource package/map mismatch problem.)
Brian_Provinciano The template took me a couple months to create. Making a game from scratch is only for experts. There's really no point in creating an empty game as you will not be able to do much without completely recreating the class system anyway. The class system contains 29 scripts, 63 classes, countless variables, instances, etc. My VGA one is even larger!
Cryptonomic
Brian Provinciano wrote:

The template took me a couple months to create. Making a game from scratch is only for experts.


Well that is what I am trying to become! :)

There's really no point in creating an empty game as you will not be able to do much without completely recreating the class system anyway. The class system contains 29 scripts, 63 classes, countless variables, instances, etc.


But humor me. As a practical exercise, the bare minimum needed to get a game working is what I have, at least according to the help file. I realize to get a full game working I would need all those other sc files. But just to get the bare minimum working is what I was looking at.

That said, keep in mind that I am also doing things based off of the template itself. In fact, I generally spend most of my time doing that and I certainly realize that is the way to go. But there is often no better way to entirely learn code frameworks (like the Class System) other than by forcing yourself to build it up by hand. (It is like learning Windows programming in C++. Yes, you can use MFC but it is much better to learn, at least at some point, how to build a Windows program from scratch without relying on AppWizards and ClassWizards.) Already by playing around with creating a game from scratch, I have learned lots of little interesting things about SCI and how things are compiled and then combined.
Paladinlover
But humor me. As a practical exercise, the bare minimum needed to get a game working is what I have, at least according to the help file. I realize to get a full game working I would need all those other sc files. But just to get the bare minimum working is what I was looking at.


Same here, now I fully understand that I have to draw all the graphics (and rip a couple of course), but I want to know, if simply a good knowledge of C++ required to make a game with SCI Studio?

I dropped the 'buy a book' project to learn, I'm going to sign up for classes in C++ at some school to learn it for a month or so, maybe longer if that's what it takes.

Till next time stay cool 8)
Eero R You can't master C++ in one month...
Cryptonomic
Paladinlover wrote:

Same here, now I fully understand that I have to draw all the graphics (and rip a couple of course), but I want to know, if simply a good knowledge of C++ required to make a game with SCI Studio?


Speaking for myself, my knowledge of C++ has not really helped nor hindered in learning SCI. SCI has classes and instances, but the conceptual details of those are a little different in SCI but the overall concepts (i.e., Object A is an instance of Class ABC) are very similar, just as would be the case for any object-oriented language.

My problem right now is not really the language behind SCI but the interconnections of the files when starting a game from scratch. The template provides the framework (just as the Visual C++ AppWizard provides a framework). What I am trying to do is step outside of the framework, at least for a little while, and look at how the framework is built from the ground-up. I highly recommend that practice to anyone who is learning a language (SCI, Java, C++, etc).
Paladinlover
You can't master C++ in one month...


I know that, which is why I said 'A month or so, even longer if that's what it takes'

I had the oppertunity to speak with a game developer at my local book shop, he told me that, "you need to learn a lot of stuff, if you want to make games like that, you need to know and practice for a year or so'.

My dad said that I needed at least 6 months of learning before I could get it right, and another collegue at work told me that it's not going to be easy to learn to use C++ to make a game entirely on my own.

Also, there is a reason why even classic games had rolls full of people who worked on a project.

If I want to make a full length game, I have to do the work of dozens of people by my self entirely. And that would be a big feat.

I prefectly understand how much it takes to learn C++, but currently, I can only spare a month since I have to go abroad for some important work, then I have to start college again.

But if I can still be in C++ school duing college, I'll stay, if not, well, then I should make use of what I learned and buy myself a big, fat book and learn more at home!

Till next time stay cool 8)
Cryptonomic In an attempt to keep the thread on topic, I am still wondering what I am doing wrong with my above description.

I am assuming that I am not the only one that has tried to explore SCI Studio in some depth, so any input/advice or whatever is greatly appreciated.

Even if we take only two elements from what I discussed above, I would be curious about these two:

[B](1) How is a resource.001 file actually created in the first place?[/B] (Is it via the rebuild or is there some other step that should happen? To what extent does the resmap.tmp file play a part in this?)

[B](2) How do I get a loose script file into a new game?[/B] (I want to create a brand new script and then get that into the resource package, without causing a corruption.)
Eigen Have you tried the Resource Manager that came with the SCI Graphic Studio. It creates the resource.map file.

EDIT: After adding an resource it creates the resource.001 file too. Now open it up in SCI Studio and you have a brand new blank game.


-Eigen
Cryptonomic
Eigen wrote:

Have you tried the Resource Manager that came with the SCI Graphic Studio. It creates the resource.map file.


Yes, the resource.map file is created the moment you create a blank game. Two files are in your blank game directory: resource.map and game.ini.

EDIT: After adding an resource it creates the resource.001 file too. Now open it up in SCI Studio and you have a brand new blank game.


Right, I seem to see that as well. In my steps, basically what I did is create the minimum game script (an sc file) that the Help file says SCI0 needs. However, in order to do that, you have to create a Vocab file - specifically Vocab.000. So I do that. (At first I just made a few entries in a completely new one; you can also just import an existing Vocab.000.) At this part there are no other resources, as there probably would not be in a brand new game.

However, if I just try to add this Vocab.000 in at the point of creating the new game, it cannot do it because there is no resource.001 file. If I rebuild first, then that resource.001 file is created and then I could add the Vocab.000 file. And I realize that can also work with a resource type as well (such as View or Pic).

[B]But here is where the main problem seems to happen....[/B]

When you try to put the all-important script in your new game, it seems you cannot even get started. To wit, I create a new script and I have to use the Script Editor on the main toolbar, not from the Game Explorer because there are no scripts at this point. I can create the script and I save it as Main.sc. Now if I try to compile it I get: "Unable to open vocab.000 for reading." I understand that is because this script is currently "loose" and not part of the game.

But then how do you get the script into the game? You cannot import it because the file is just Main.sc and not Main.sco. But I cannot compile it to Main.sco because it is not part of the game! There is sort of a vicious circle here.

[B]Now here appears to be the solution ....[/B]

You cannot do this from within SCI Studio. You have to get the stand-alone Script Compiler. Then copy your main.sc and your Vocab.000 to that directory. Then run scc.exe on your Main.sc file. That will create two files: Main.sco and script.000. You can now import script.000 into your blank game and it will work fine.

Of course, the problem now is you can still not edit that script, even if you keep the Main.sc and Main.sco files in the directory of your blank game. And another problem is still that if you try to rebuild you will still get those exact same errors that I mentioned before. (The new tutorial I am writing also covers writing a game from scratch, which is why I am investigating different possibilities. Basically one part of the tool is intrasparent, the other is not. That is the conclusion I have come to.)
Cryptonomic AH HA! Finally got it.

You have to create the Vocab.996 and Vocab.997 files as well then add them as resources. Also, critical step here: remove resmap.tmp. Once I removed that file, the corruption errors went away and so did most of my problems.

Now I can edit my Main.sc and Game.sh files in the Script Editor and have them as part of my game. I can also add resources without problem.