forums

TNT Basic Forums > TNT Basic - The Open Source Edition
How to build TNT Basic from source
< Last Thread     Next Thread >
Author
Thread        Post A Reply

11-24-2005 00:19

Posted by:
Mark Tully

Location:
TNT HQ, England

Click Here to Email Mark Tully   Find more posts by Mark Tully

OK, I've finally got the source code for TNT Basic out of the door - all you budding hackers can now go and grab it and build yourself some TB!

The sourceforge webpage is http://sourceforge.net/projects/tntbasic .

The source code for Hieroglyph isn't out yet, but I'll make it available over the next week or so. There's bit of tidying up and a few library shenanigans that need sorting out yet.

The following instructions describe how to build the source code. They're from the README file that comes with the source. The latest version of this file can be viewed online here: http://cvs.sourceforge.net/viewcvs.py/tntbasic/README?view=markup .

Hopefully these instructions are relatively straight forward, post any questions and I'll use them to improve the README.

Basically:
1) Get MacCVSX as described in the README below. It is important to use this version of CVS, otherwise the resource forks of files in the repository won't come through to you.
2) Checkout the source using the version of cvs from MacCVSX:

quote:
> cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/tntbasic login
(enter empty password)
> cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/tntbasic co .



Alternatively use the GUI version to make things even easier on yourself.

1) Set the CVSROOT in the preferences to the following:
Authentication: pserver
Path: /cvsroot/tntbasic
Server: cvs.sourceforge.net
Account: anonymous

2) Create a new browser:
'File -> New Browser' Create an empty directory where you want to check the source out to and select it.

3) Login
'Admin -> Login...' Enter an empty password.

4) Checkout the source
'Remote -> Checkout module...' Enter the module as . (<- meaning enter a full stop) to get everything

You can read more about sourceforge's CVS service here. You can also browse the source code online here

quote:
README
Mark Tully
23/10/05

Welcome to the TNT Basic source code repository.

CVS Access and the cvsgui tool
------------------------------
Because the repository contains Mac resource files, you will need to use a specially modified version of
cvs to check them in/out. You can use normal cvs to check in/out all source files, but if you check out
a resource file with normal cvs it will appear corrupted. If you've just checked this lot out with normal
CVS, throw it all away, get the special CVS, and start over.

The version of CVS to use is provided by the cvsgui project, www.sourceforge.net/projects/cvsgui . The
version I used is MacCVSX-3.3-alpha2. It comes in a GUI version and a command line version. The GUI version
is very good and can be used instead of the cmd line version no problem. I however prefer using the cmd line
as I'm a Unix geek, and so I've copied the cvsgui cmd line tool out of the MacCVSX.app package and renamed
it to 'cvs' and placed it in my shell command path so that it takes precedence over the built in Mac OS X
version of cvs. Once this is done I can forget about it.

Note that this version of CVS is 100% compatible with normal CVS repositories and won't cause any problems
if you use it with CVS repositories other than the tntbasic one. All it does is do a CVS wrap on any binary
files with resource forks to make them into AppleDouble or BinHex files. When it checks a file out, if it
has been encoded in this way it decodes it creating the original resource fork again.

CVS Committing
--------------
There will be a select few with commit permissions to CVS. All source code alterations must be sent to these
people for review, and they will then commit them to CVS. Overtime, people who repeatedly prove themselves
trustworthy will be given commit permissions, then build release permissions and finally admin control
on the tntbasic.com website.

At this time, all source code alterations must be sent to:

Mark Tully (mark at tntbasic dot com)

Building - REQUIREMENTS:
------------------------
REQUIREMENT 1: Mac OS X
You can build on OS 9, but you'll need OS X to be able to generate the parsers using the command line tools
flex and bison. You'll also need OS X to generate the documentation from the documentation source files. If
you have done at least one build under OS X, you will then have the necessary files to repeat the build under
OS 9 if required. Note that building under OS X or OS 9 builds a carbon app that will run under either OS, so
OS 9 is not required for building.

REQUIREMENT 2: Additional source archives
First make sure that you have downloaded the additional source archives from http://www.tntbasic.com/download .
These are achives of source that cannot be redistributed via CVS. Please see the file third_party/README
for more information.

REQUIREMENT 3: Metrowerks CodeWarrrior 8.3 or better
To build TNT Basic you need to have Metrowerks CodeWarrior. This is because, at this time, TNT Basic uses
the PowerPlant application framework which comes with CodeWarrior. See note on XCode further down this document.

REQUIREMENT 4: Developer tools
gcc/flex/bison and XCode are required - just install the DevTools that came with OS X.

Building - STEPS
----------------
STEP 1: Build the TNT Basic parsers
The parsers are written in flex and bison. You need to use the command line tools flex and bison to generate
the parser source code, which will then be compiled by CodeWarrior. Open a terminal, cd into 'tb/Source/Parser'
and type 'make'

STEP 2: Build TNT Basic
Open 'tb/TNTBasic.mcp' in CodeWarrior and hit build. I have been building in CW 8.3. Later versions of
CodeWarrior may require the project file to be updated, any may require minor modifications to the
source code. If these are necessary, please submit the relevant changes back into CVS.

STEP 3: Build tbformat
tbformat is a Mac OS X cmd line tool that will format some TNT Basic source code into syntax highlighted HTML.
Open 'tb/TBFormat/TBFormat.xcode' in XCode. Hit make.

STEP 4: Build the documentation
A lot of the documentation is stored in HTML inside 'tb/Distribution/TNT Basic Help'. However, a move is being
made to the more flexible .hlp files, which are stored in 'tb/Help Source'. If you change any HTML based
documentation, please consider moving it to the more modern .hlp file at the same time. It doesn't take long
to do.
To build the HTML documentation from the .hlp files, open a terminal, cd into tb/HelpSource and type:
'formathelp.pl -t', this will build a commands index of all the commands that are currently documented, it will
then use this commands index to automatically hyperlink the documentation. You only need to do this command rarely,
read the comments at the top of the formathelp.pl for more information.
Next type 'formathelp.pl' this will convert all .hlp files to HTML using the tbformat tool built at step 3 to
format any TNT Basic source code into HTML. Currently, formathelp.pl only converts to HTML.

****** You should now have an executable of TNT Basic with all its documentation.

STEP 5: Build Hieroglyph and it's Blocks
TODO

XCode?
Technically, if you had PowerPlant, you should be able to get TNT to compile under XCode, however, having
PowerPlant means that you'll also have CodeWarrior, so you may as well use the existing CodeWarrior project.
An XCode project could be created, however this would only be able to build the Mac OS X build of TNT Basic,
as XCode cannot and never will be able to build classic Mac apps. The medium term aim is to eliminate the
PowerPlant dependency from TNT Basic and move the project to XCode. Also, once in XCode we can build on Intel.

Overview
--------

bin
Some utilities and scripts for working with TNT Basic - miscellaneous stuff

glyph
The source for the Hieroglyph editor and all its plug ins or 'blocks' as they're known.
Not of all the blocks found here shipped with the version of Hieroglyph that was bundled with TNT Basic's
earlier distributions.

mid
Pyramid, or mid as it is affectionately known, is the template editing library used by Hieroglyph. This
directory contains the source for Pyramid 2.0, which never got completely finished. Pyramid 2.0 is compiled
into Hieroglyph however, it is Pyramid 1.0 that is currently mainly used.
Pyramid 2.0 is a complete rewrite of the template library, to support multiple views of data and scripting
support. Although never finished, it's probably the best bit of Hieroglyph and could easily be rolled out into
its own app as a data editor. At the very least, with a bit of extra work, it would allow TNT Basic games to
have custom resources with editors very easily.

mr
This is a legacy directory name standing for 'Marks Routines' which was the precursor to 'TNT Library'. It's
basically all useful source code that John and I ever wrote, ever. TB and Glyph use a lot of it, but there's
loadsa stuff in there that they don't use, and loadsa stuff that's very old and crusty that we wrote when we
were first learning C. It is truly a source archive.
Incidentally, this is where you will find the BLAST and BLAST++ sprite and graphics libraries, as well as
the rest of the engines that run TNT Basic, such as the Sparks networking library and the Kaboom sound library.
If you wanted to create a game outside of TB, this is probably where you'd be grabbing source from.

third_party
This directory contains source code that was originally written by authors other than Mark Tully and John Treece-Birch.
Some of the third party modules used by TNT Basic have been placed into TNT Basic's CVS repository. Others,
for various reaons, have not. The ones that have not been placed in CVS can be downloaded from the TNT Basic
website at http://www.tntbasic.com/download. They should then decompressed into this directory.
See third_party/README for more info.

tb
Here you'd find the source for TNT Basic itself. The user guide and the help html files can also be found in
here, as well as a tool called 'tbformat' that will process a text file with TNT Basic source in it and produce
a HTML file with syntax highlighting. There are several TNT Basic code examples in here too which didn't see
public release.
The HelpSource directory contains .hlp files which are used to generate the html help files used in the manual.
Not all pages in the manual are produced from .hlp files, but they should all be moved over as the .hlp format
is more flexible and allows for better format control and potentially coversion to other formats such as PDF.


11-24-2005 07:16

Posted by:
allnodcoms

Location:
hertfordshire (England)

Click Here to Email allnodcoms   Find more posts by allnodcoms

Christmas comes early!

Great news fella, not downloaded yet because I had to post here first, oh, and I've got to make a really big "DO NOT DISTURB!" sign for the office...

So with a fresh pot of coffee and enough fags to keep me going till next Tuesday, I'm going in! Expect the compiler by about 2 O'clock!

Ooh I'm all excited...

Danny (nods) 8D

11-24-2005 07:46

Posted by:
allnodcoms

Location:
hertfordshire (England)

Click Here to Email allnodcoms   Find more posts by allnodcoms

Downloaded...

Browsing now....

Better make that 2.30 ;)

Danny (nods)

11-24-2005 22:59

Posted by:
someone

Location:
Quebec ( Canada )

Click Here to Email someone   Find more posts by someone

too bad it doesn't work with XCode... i don't have CodeWarrior

11-24-2005 23:38

Posted by:
allnodcoms

Location:
hertfordshire (England)

Click Here to Email allnodcoms   Find more posts by allnodcoms

Neither do I !!

We are working on this as I type and a bulletin will be released very soon. Apparently Metrowerks are releasing PowerPlant (their C++ lib) as Open Source in the next few weeks. This is what ties TNT to CodeWarrior, so with an Open Source library to link to we can export the CW project file to XC (with XC's import assistant) and have XC native projects (news direct from TNT HQ).

Watch this space... We're getting there!

Danny (nods)

11-25-2005 17:30

Posted by:
Jason Anderson

Location:
Doylestown, PA

Click Here to Email Jason Anderson   Find more posts by Jason Anderson

So, how long before we see a nice big speed increase?

11-25-2005 22:59

Posted by:
Mark Tully

Location:
TNT HQ, England

Click Here to Email Mark Tully   Find more posts by Mark Tully

I've got some fairly well fleshed out ideas in this area, but they'll be OS X only. I'm thinking about leveraging GCC to compile straight into machine code. Once we have this our main bottleneck will be graphics, but we'll improve the OpenGL support and get more out the gfx card. Both of these will mean that a transition to 3D would be easier.

I'm thinking we focus more on OS X, whilst we want to maintain compatability with OS 9 for as long as possible, I'm not going to let it hold TNT back. Eg the compile for machine code won't work on OS 9, but by the time it happens, Apple will be pushing Intel Macs at us and OS 9 will be a distant memory.

So how long for speed ups you ask, at least 6 months before anything major.

Mark

11-25-2005 23:08

Posted by:
Jason Anderson

Location:
Doylestown, PA

Click Here to Email Jason Anderson   Find more posts by Jason Anderson

I apologize to any Classic users still out there, but...

Cocoa-ize this app ASAP.

Drop OS 9. As soon as the app is up to speed so to speak, there will be no reason to keep it. There is no reason to keep it. There are hardly any OS 9 users left and even those using OS X are not willing to boot into Classic or OS 9 to run a game anymore these days. I hate to say it but OS 9 is dead. Viva la OS X revolucion. Viva la death to OS 9 support.

PLEASE!

For ONE thing, OS 9 will be completely dead, whatever was left of its life, as soon as the Intel Macs start coming out. Sorry to say no one is supporting OS 9 anymore. If someone really wants to use OS 9, they have TNT 1.3 to use. But please, 1.4 MUST be OS X only for our sake. Take advantage of all that cool OS X stuff. Revamp the GUI. It's too OS 9-like which is a bad thing. Bad in a GraphicConverter sort of way. That app is great, but it still reeks of OS 9 styled interface design.

Please? Pretty please with Aqua cherries on top?

11-26-2005 00:40

Posted by:
allnodcoms

Location:
hertfordshire (England)

Click Here to Email allnodcoms   Find more posts by allnodcoms

6 months seems realistic...

There may be minor releases in the interim, but if you are looking for something that will blow your socks off then I'd not go holding your breath in anticipation... BUT I must say again that this is now Open Source, so who knows what people will come up with? It's a case of watch and see... "Patience is a vitue".

Danny (nods)

11-26-2005 11:22

Posted by:
Mark Tully

Location:
TNT HQ, England

Click Here to Email Mark Tully   Find more posts by Mark Tully

Jason,

As you can see from my previous post, we agree about OS 9 and the inevitability about its demise due to MacTel.

I personally don't see much benefit in rewriting the GUI to be slightly different, I'd rather spend time on other things like making it faster or adding new features.

But, like Danny, said, it's open source, so someone else might feel strongly enough about the GUI to redo it all.

Cheers,

Mark

11-26-2005 17:17

Posted by:
DanLurie

Location:
Earth>USA>New Jersey>Clifton>My Chair

Click Here to Email DanLurie   Find more posts by DanLurie

quote:
So with a fresh pot of coffee and enough fags to keep me going till next Tuesday...


You Brits might want to remember that fags has an utterly different meaning to us Ugly Americans. ;)

11-26-2005 18:04

Posted by:
allnodcoms

Location:
hertfordshire (England)

Click Here to Email allnodcoms   Find more posts by allnodcoms

Thanks for the tip Dan...

Next time I'll just say homosexuals and be done with it.

Danny (nods)

11-27-2005 11:39

Posted by:
Mark Tully

Location:
TNT HQ, England

Click Here to Email Mark Tully   Find more posts by Mark Tully

LOL - excellent!

11-30-2005 23:29

Posted by:
matteo

Location:
Venice, ITALY!

Click Here to Email matteo   Find more posts by matteo

Has anyone actually managed to build this?

(Dont look at me, it took me about 2 years just to get SDL+OpenGL working...)

12-01-2005 00:18

Posted by:
allnodcoms

Location:
hertfordshire (England)

Click Here to Email allnodcoms   Find more posts by allnodcoms

It can be done.... but it's a pain in the arse!

You need to download the Evaluation (15 day unlimited use) or LE (limited to 30 source files, but no time limit) version of CodeWarrior from Metrowerks. You can then use XCode's import project assistant to get the thing across, you can't do this without CodeWarrior. This is where the fun starts! The project doesn't (when I tried it, several times!) copy across the correct access paths, so you need to manually edit these paths under the 'Get Info' equivalent, but first you need to find 'em! I used Spotlight. Takes days! I'll get a 'sanitised' version of an XCode project working (using default CW install and the Source code root in User Home) and post to the directory. It might work, but you will still need CW to access the PowerPlant source files (which TNT relies on quite heavily... They initialise the Toolbox for example!). PowerPlant is going Open Source very soon, I've been on the line to the head of PP development at Freescale and we're talking days, weeks at most. With PP out in the open we can rebuild the project files with XC and all should be well with the world. I highly recommend downloading CW anyway, it's a great piece of kit and comes with mountains of documentation on all things Mac (21 e-books).

ftp://ftp.metrowerks.com/pub/tools/CW_Tools_10_0.dmg (173.5 mb)

AND

ftp://ftp.metrowerks.com/pub/tools/license.dat

Hope this helps Matteo; with CodeWarrior it can be done, but without it you've got your work cut out!

Have fun dabbling!

Danny (nods)

12-03-2005 05:40

Posted by:
matteo

Location:
Venice, ITALY!

Click Here to Email matteo   Find more posts by matteo

No, seriously I'm bad at this kind of stuff and I hate it.

I mean I'm REALLY bad. until about 2 weeks ago I didn't even manage to link libraries. Now I think I got it though.

Anyway, I AM learning c++, SDL and opengl so possibly I can give you a hand with TNT, to which I am damn grateful, it probably changed my life, now I'm going full time indie :)

[Offtopic: After TNT I got blitzmax that helped a lot to the transition to C++, teaching more "functional" approaches and object orientation. Now I'm doing this http://img213.imageshack.us/img213/8071/teaser1zb.png in SDL&OpenGL.]

As I said though I'm absolutely not the "tech" guy, I more of a games/algorithms/physics coder. I dont even know what is "the path" and how to change it, how to compile a library :P.

But I can do a physics library if you need one ;)

12-05-2005 14:29

Posted by:
DanLurie

Location:
Earth>USA>New Jersey>Clifton>My Chair

Click Here to Email DanLurie   Find more posts by DanLurie

TNT's largest weakness, I think, is the IDE and the lack of real functions.

Oh...and the sluggish hardware mode.

12-05-2005 18:14

Posted by:
allnodcoms

Location:
hertfordshire (England)

Click Here to Email allnodcoms   Find more posts by allnodcoms

Hardware Mode...

I've been having a play with the OpenGL code for about a week now, and some other bits and pieces which don't make sense, and I'm starting to get an idea of what's going on. It's been slow going, but give me another week or so and I should have the solution to the Hardware Mode problems. Whether I've fixed them or not is another matter!

Watch this space...

Danny (nods)

12-07-2005 16:54

Posted by:
Jae Rune

Location:
Cheyenne, WY

Find more posts by Jae Rune

Lemme know when you guys have the source all opened up and not relying on the CarbonLib anymore and you've got he SDL or OpenGL version going and I'll see about porting this to Windows. Just as a larf.

And because I'm back on the Windows box again. Damn my obsession with GTA:VC...

12-07-2005 20:17

Posted by:
allnodcoms

Location:
hertfordshire (England)

Click Here to Email allnodcoms   Find more posts by allnodcoms

Get a PS2! ;)

(but thanks for the offer Jae... We'll keep that in mind)

Danny (nods)

12-08-2005 15:21

Posted by:
Jae Rune

Location:
Cheyenne, WY

Find more posts by Jae Rune

I can't play it on PS2. The aiming system is too weird to use when you learned it first on a mouse. I can't play any console-based FPS. I need a mouse to do my work.

But, still... I don't think porting this to Windows would be a terrible idea myself. Of course, it'd kinda take away from it being a great Mac-only app. Kinda. :)

02-04-2006 11:13

Posted by:
Wil Hostman

Find more posts by Wil Hostman

Windows Version

I personally think a windows version would be useful, or at least a bindable interpreter for the windows platform, even if the development cycle is strictly MacOS.

I concur on the OS9 issue; that being said, however, the local school district is using "new" software which is still OS9 reliant: FastForWord, a language skills development CAI/CDI package. FFW is rereleased each year; this school year's is still OS9. So it's not dead yet, but is in "Legacy" mode.

So here's the real question:

How much of the bindable interpreter is written with mac-specific code?

02-05-2006 12:05

Posted by:
allnodcoms

Location:
hertfordshire (England)

Click Here to Email allnodcoms   Find more posts by allnodcoms

RE: Windows version.

Wil, TNT uses the PowerPlant framework from MetroWerks (recently open sourced), this is a set of cross platform C++ classes that add an abstraction layer over the top of the platform specific APIs. This means that in theory a Windows version of both the runtime interpreter and the editor should be a reasonably simple build. But in practice there is a fair bit of optimisation and very proprietary jiggery pokery going on. Whilst this is not difficult to alter, it would take out that could be better spent enhancing the current Mac version.
Take a look at this thread which discusses the point in more detail.

Danny (nods)

02-05-2006 16:47

Posted by:
Mark Tully

Location:
TNT HQ, England

Click Here to Email Mark Tully   Find more posts by Mark Tully

> How much of the bindable interpreter is written with mac-specific code?

Not too much. PowerPlant is fairly infused into Hieroglyph, but it would be quite easy to remove it from TNT Basic itself. The GFX code should be fairly easy to port, it wouldn't be too hard overall to get TNT Basic working on Windows. The editor would be a complete rewrite.

If some windows programmer wants to step forward and port TNT Basic then be my guest - that's the point of open source. I'm personally going to continue developing the Mac version.

Mark

10-06-2006 04:28

Posted by:
appleide

Click Here to Email appleide   Find more posts by appleide

"4) Checkout the source
'Remote -> Checkout module...' Enter the module as . (<- meaning enter a full stop) to get everything"

error: connection refused.

10-06-2006 17:41

Posted by:
someone

Location:
Quebec ( Canada )

Click Here to Email someone   Find more posts by someone

did you login
and maybe try again later sometimes sourceforge is down

10-09-2006 04:11

Posted by:
appleide

Click Here to Email appleide   Find more posts by appleide

I used the GUI version, I got connection refused. I went into preferences and checked Proxy server and tried again. No error message, then i went on to check out module, no errors either, but nothing happens.

So I went to use the command line, and I got this:

cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/tntbasic login
Error : cannot chdir to (error 2)!
cvsgui [login aborted]: connect to cvs.sourceforge.net(66.35.250.207):2401 failed: Connection refused

10-09-2006 14:02

Posted by:
someone

Location:
Quebec ( Canada )

Click Here to Email someone   Find more posts by someone

i get the same thing here

i believe sourceforge is down. try again later, it happens often with sourceforge i believe

11-01-2006 21:46

Posted by:
Mark Tully

Location:
TNT HQ, England

Click Here to Email Mark Tully   Find more posts by Mark Tully

No, sourceforge just changed their servers around, the correct updated usage is explained here:

http://sourceforge.net/cvs/?group_id=135906

Essentially:

cvs -d:pserver:anonymous@tntbasic.cvs.sourceforge.net:/cvsroot/tntbasic login
(enter empty password)
cvs -d:pserver:anonymous@tntbasic.cvs.sourceforge.net:/cvsroot/tntbasic co .

Hope this helps,

Mark

04-02-2008 17:10

Posted by:
JasonGawker

Click Here to Email JasonGawker   Find more posts by JasonGawker

Hey

Hey!


Thanks for a great post. You guys are doing a real impressive job with TNT basic. I love the idea behind it, the open source code, OpenGL, and everything else. My little suggestion is trying this place that can provide you with a lot of useful books full of great information.

My two cents,
Jason

04-03-2008 10:40

Posted by:
appleide

Click Here to Email appleide   Find more posts by appleide

This looks like a really smart robot to me. But nonetheless, still a stupid AI because it pointed us to books about self-confidence, 'unleashing the "TNT power within us"'. I guess it'll be a while before AI's can learn what metaphors are.

04-08-2008 12:19

Posted by:
Jacob

Location:
San Francisco, CA

Click Here to Email Jacob   Find more posts by Jacob

It's just a post you say lol! to sorta ;)

01-31-2009 19:54

Posted by:
elle

Click Here to Email elle   Find more posts by elle

cant install tnt in my mac...help

I need help on how can I install tntbasic in my mac os x...I already downloaded the tntbasic vers 1.31...when I tried to open it, it just open using the text edit. Please help asap!

02-02-2009 11:51

Posted by:
Jacob

Location:
San Francisco, CA

Click Here to Email Jacob   Find more posts by Jacob

Did you get it from the first link on the downloads page at the top? (http://tntbasic.com/download/)

If so, try this: http://www.frankenspud.com/downloads/TNTBasic131.zip

08-23-2010 17:39

Posted by:
Maxime

Location:
Paris France

Find more posts by Maxime

Were are the msgs ?

Something goes wrong on my Mac : The Post list notes in the index of "The Open Source Edition", first item : Mark Tully ...03-19-2010 16:34. (Which is good news of Mark's active) But inside, I can find no msg later than 02-02-2009 11:51 by Jacob. This happens with SAFARI and Firefox.
Does a recent msg from Mark-Tully exists ?

09-10-2010 18:36

Posted by:
Jacob

Location:
San Francisco, CA

Click Here to Email Jacob   Find more posts by Jacob

My 02-02-2009 message is the last one before yours. I don't see any new ones from Mark Tully.

All times are GMT        Post A Reply

Forum Jump:
< Last Thread     Next Thread >

< Contact Us - TNT Basic >

Powered by: vBulletin Lite Version 1.0.1 Lite
Copyright © Jelsoft Enterprises Limited 2000.