forums

TNT Basic Forums > Feedback
Things to improve TNT Basic
< Last Thread     Next Thread >
Author
Thread        Post A Reply

11-28-2005 18:23

Posted by:
Jacob

Location:
San Francisco, CA

Click Here to Email Jacob   Find more posts by Jacob

To improve TNT:

New Features:


Multiple sounds
Transparent Tiles
Built-in Image editor
Built-in sound recorder and editor
Make it so you can't open any TNT projects from a built application

New functions:

Saving and loading variables:
Save(what to save, what file to save it in, where in the file to save it)
variable=read(what file to read from, where in the file to read it from)

Procedures:
Procedures returning more than one variable:

The returned variable is exactly like defining a variable.

Example:
--------------------------
Window mode 640,480

While not pressed(12)
define()
For i=0 to length
frame oval x-i*2,y-i*2 to x+i*2,y+i*2
Next
Wend

Procedure define()
'Code goes here
End Proc(float x=mouse x, float y=mouse y, float length=100,int i)
--------------------------
Text transparency

Cursor none, normal, image id

Ink or Light based
Make the drawing mode light or ink based

Example:
--------------------------
Set drawing mode light based
or
Set drawing mode ink based
--------------------------

Other:

Lines in lines
colin=exactly the same as a new line
Example:
--------------------------
If x>0:x=0:y=0:end if
--------------------------

And Labels are
Label label name

Jacob

11-29-2005 11:55

Posted by:
allnodcoms

Location:
hertfordshire (England)

Click Here to Email allnodcoms   Find more posts by allnodcoms

RE: Things to improve...

Here we go with the list:

1) Multiple sounds. Sound support hasn't been commented on much, but I see no reason why we shouldn't provide better facilities. There are other, higher priority things to do first but you never know...

2) Transparent tiles. Working on it, maps will soon be able to use sprites as well as single 'tile sets'. Watch this space.

3) Image editor. Like this one, thought about it myself a few times. Was drawing up a utility in RB which had far greater functionality for sprites, but shelved due to an imminent rewrite of Hieroglyph. The editor needs many tweeks.

4) Sound editor. Not my area of expertise this, so will have to bow to down to those more in the know, but sounds (excuse the pun!) a bit tricky.

5) Built Apps. Already got a draft spec. for a 'compiled' resource file format to be built in to final apps. Will make stuff harder to rip, but people will always get round this, especially if the format is available as Open Source...

6) Save and load changes. This, I'm afraid, is unlikely to change as there really is no need for it to. If you want this sort of syntax revision you could always just write a wrapper call in basic and use this instead.

7) Procedures. Procedures will never return multiple variables, and defining a global variable within a procedure is, quite frankly, a bit scary. Why would you want to? Procedures should become 'functions' which can be used as the right side of an assignment, this I agree with, but the other suggestions are not necessary and, more importantly, bad coding practice. Use global or shared variables instead, or wait 'till the memory management calls are implemented and return a single 'pointer'.

8) Text. Transparency when printing strings, don't we have this already? Unless you mean alpha blending, which may happen once hardware mode works properly. The ink and light bit I really didn't get at all...

9) Composite lines. Er, why? Code is meant to be read by a human, not a computer. If it was the other way round it would just be a string of one's and zero's. Splitting lines helps to break up the various loops and decisions, and makes reading the source easier on the eye. It would be no quicker, so again, I don't see the need to add this (and who's Colin?).

10) Labels. 'main:' || 'label main', surely the first (and current) way is easier?

Well thanks for the suggestions, and I hope this has gone some way to letting you know how we're doing, and what we're doing. Mark is putting together a feature request database that will hopefully appear on the sourceforge pages (here) in the not too distant future, and I'm sure posts will be made on this site whenever new features or updates become available.

Danny (nods)

11-29-2005 17:22

Posted by:
Jacob

Location:
San Francisco, CA

Click Here to Email Jacob   Find more posts by Jacob

About the colon

This line works...

If x<0 : x=0 : xv=0 : end if

This line dosen't work...

If x<0:x=0:xv=0:end if

See?

I like the colons because it makes the code easier to read:

---------------
If x<0
x=0
xv=0
End if

If x>screenWidth
x=screenWidth
xv=0
End if
---------------
or
---------------
If x<0:x=0:xv=0:End if

If x>screenWidth:x=screenWidth:xv=0:End if
---------------

Jacob

11-29-2005 17:27

Posted by:
Jacob

Location:
San Francisco, CA

Click Here to Email Jacob   Find more posts by Jacob

About saving and loading files

To save an array of sprites all in one file isn't to easy.
And if you wanted to call a variable from a section of a file isn't too easy either.

It's just a way to make it easier to save and load games, with saving the current level, and all object positions and velocities.

11-29-2005 19:08

Posted by:
Jacob

Location:
San Francisco, CA

Click Here to Email Jacob   Find more posts by Jacob

Ink and light based

TNT Basic currently used ink based drawing.
Light based drawing is like if you draw a 50% transparent red oval over a green one the red oval will lighten the green color.

11-29-2005 22:59

Posted by:
someone

Location:
Quebec ( Canada )

Click Here to Email someone   Find more posts by someone

it's not TNT's job to edit sound and images... just get GIMP, Audacity, or other freeware programs...

what i'd like to see is the ability to return variables from a proc without the return int thing, and maybe also midi playback... MOD is great but little mod editors work on mac now that PlayerPro is gone
and maybe split the code in many files so that yo udon't get lost in big projects

11-30-2005 00:26

Posted by:
allnodcoms

Location:
hertfordshire (England)

Click Here to Email allnodcoms   Find more posts by allnodcoms

Light / Ink...

Yup, you're talking about alpha blending, this may happen but needs to wait until hardware mode works properly (which I'm working on as we type!). As for the saving of game data, it's actually a lot easier than you think, and your suggestion wouldn't help matters. Check out this link for a full explanation of the base mechanics. It's not that difficult...

Danny (nods)

11-30-2005 00:55

Posted by:
Jacob

Location:
San Francisco, CA

Click Here to Email Jacob   Find more posts by Jacob

It's not so hard untill...

Let's say theres a file with 100 names in it, and you want to call the 53rd name in the list. Is that easy?

If you could, it would be nice if you could write some code that does it.

11-30-2005 07:02

Posted by:
Jae Rune

Location:
Cheyenne, WY

Find more posts by Jae Rune

Actually I think it'd be damn nifty if TNT had the ability to do vector art. That'd just be stellar. But I'm not holding my breath, to be honest. :)

11-30-2005 14:59

Posted by:
DanLurie

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

Click Here to Email DanLurie   Find more posts by DanLurie

quote:
3) Image editor. Like this one, thought about it myself a few times. Was drawing up a utility in RB which had far greater functionality for sprites, but shelved due to an imminent rewrite of Hieroglyph. The editor needs many tweeks.


RB, eh? Care to share the code on that utility? I had similar aspirations a year or two ago.

11-30-2005 21:21

Posted by:
allnodcoms

Location:
hertfordshire (England)

Click Here to Email allnodcoms   Find more posts by allnodcoms

Random access file structures...

Jacob, if you have an array of strings which you want to be able to save to disk and access randomly you have really got to save a 'structured' file. Here's the most common way to do that:

Begin your file with 100 (in your case) ints, each int represents the start location of a particular string in the file. The first value will be 400 (as ints are four bytes, so 100 will occupy bytes 0-399), the second value will be previous value plus length of next string, and so on... To find the 53rd string (index 52), you set the file pointer to 52*4 and read two ints, the first is the address of your string, and he second is the address of the next, so the difference between the two is the length of the string to read... Just remember to check for the end of the look up table. Doddle really.

Dan, I was talking to Mark about a revised editor in RB, the plan is (a LONG way down the road) to take TNT cross platform, and RB seemed the logical move. I did a fair bit of prep work on it, but it was in the days before I had access to TNT's internal resource data formats, so little in the way of specific code. It's one of those things I go back and play with from time to time, so I might well post some code to the Directory if I get something worthy of a look. I'll keep you posted! (It's in RB 5 btw)

Danny (nods)

11-30-2005 21:51

Posted by:
allnodcoms

Location:
hertfordshire (England)

Click Here to Email allnodcoms   Find more posts by allnodcoms

Oh, by the way Dan...

The decision was made that it would be easier (due to the other things that Hiero does) to re-write it in C++ using the soon to be Open Source PowerPlant libraries and layout tools that came with CodeWarrior, so plans for an RB version were shelved. If anything comes of it, it will be an external editor for sprites and the like, but hopefully some of the ideas will make it into the C++ version.
Thought I'd clear that up...

Danny (nods)

11-30-2005 21:57

Posted by:
DanLurie

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

Click Here to Email DanLurie   Find more posts by DanLurie

Too bad. I think RB would be an awesome way to do a new UI for it. The guts of the code could be moved to RB plugins.

Ah well. Don't mind me. Just meddling. :p

(wants to help---hates C++)

11-30-2005 23:52

Posted by:
allnodcoms

Location:
hertfordshire (England)

Click Here to Email allnodcoms   Find more posts by allnodcoms

(Hate C++ Too!)

But at least it's better than ObjC. ANSI man myself, ++ carries too much baggage...

Danny (nods)

12-01-2005 17:52

Posted by:
Jacob

Location:
San Francisco, CA

Click Here to Email Jacob   Find more posts by Jacob

RealBasic is much slower than C++
(all apps I download that are made in RealBasic are slow)

12-01-2005 18:06

Posted by:
allnodcoms

Location:
hertfordshire (England)

Click Here to Email allnodcoms   Find more posts by allnodcoms

Must of just been very unlucky...

RB compiles to machine code, same as C. We would only want it to edit sprites and maps, so speed, or the lack of it, wouldn't make a blind bit of difference anyway. On the big plus side, it's one of the best cross platform, low budget examples of RADE software out there, it's easy to use, easy to learn and extendable through plug-ins... All sounds kind of cool to me.

Danny (nods)

12-01-2005 22:56

Posted by:
someone

Location:
Quebec ( Canada )

Click Here to Email someone   Find more posts by someone

i don't know about RB, but to me programming big apps in BASIC would be much harder than in an OO language (or maybe RB includes some OO now?)

however the problem with RB, is that as far as i know you must buy it. on the opposite, C/C++/ObjC can be used freely with XCode on every mac os X computer - so doing anything in real basic would limit a lot the number of programmers that will work on it.

12-01-2005 23:30

Posted by:
allnodcoms

Location:
hertfordshire (England)

Click Here to Email allnodcoms   Find more posts by allnodcoms

RB is totally Object based.

More traditional versions of BASIC don't touch OO, but RB is based on it. You do need to buy it, but as a starting point to cross platform development it leads the way. C and its derivatives are free, but code you write on one platform wont necessarily compile and run on another, the entire interface would need a re-write for example, memory management and byte level access is (at the moment!) completely the wrong way round, the list continues... RB handles all this for you, removing the need to learn two separate interface frameworks (which if you've ever done it, you will appreciate the need not to!).
God I sound like a sales rep.! I'm not trying to sell RB here, I love C and always have done, was just trying to balance the speed argument. Well I've rambled on (again!) for far to long... Back to Basics!

Danny (nods)

12-05-2005 14:33

Posted by:
DanLurie

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

Click Here to Email DanLurie   Find more posts by DanLurie

Not to turn this into an I-LOVE-RB thread, but RB is object oriented. Its very good for building GUI apps, but the speed is less than ideal for action games.

I don't think it would be that big a deal to redo the IDE in RB as opposed to Powerplant.

12-13-2005 22:48

Posted by:
Mark Tully

Location:
TNT HQ, England

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

Just in case people aren't aware:

Hieroglph is a general purpose resource editing tool.
It supports plug in based resource formats (eg the .tbproj and the mac .rsrc format, as well as future ones such as the more archive based one Danny mentioned).
It supports plug in based editors, the TNT Basic code editor just being one of them.
It supports arbitrary data editing using the pyramid template library.
It has nicities such as AppleScript and drag and drop.

Hieroglyph is way more powerful than the TNT Basic interface that TB users work with, and more importantly, it's already written. Adding new features, resource types, file formats etc to Hieroglyph is easy.

I just thought I should make people aware of this before anyone embarks on rewriting what is already a pretty capable and flexible resource editing tool. In my opinion, there's no gain in doing so at this time.

12-13-2005 23:02

Posted by:
someone

Location:
Quebec ( Canada )

Click Here to Email someone   Find more posts by someone

anyway i never understood those who said the interface was terrible... i guess the map editor needs some update but otherwise it's not that bad...

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.