Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, Aku_Aku, ozgur), 1,095 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Lite Foundation (now with beginner support) #343108
10/03/10 18:41
10/03/10 18:41
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline OP
Expert
WretchedSid  Offline OP
Expert

Joined: Apr 2007
Posts: 3,751
Canada
My first topic about this project was maybe a little bit too deterrently for everyone, I didn't described the project but threw a bunch of code files at you.
I can understand that this is not a good idea, so I decided to create this new topic.

So what is Lite Foundation?
Lite Foundation is a library to make your life as programmer easier. It provides you with an foundation for your project and helps you to reduce a lot of boilerplate code (boilerplate code is code that you need to write over and over again for all your projects). It contains functions and objects that help you to work with dynamic arrays, binary data, timers and moar.
It is also easy extendable so you can add your custom types that profits from the Lite Foundation magic.
The magic of Lite Foundation is described completely in the getting started pdf file that is included with this release. So if you didn't knew where to start with Lite Foundation and/or what you could do with it, there is a document for you.
Together with the getting started documentation is a full reference for every object and function and there are also 11 examples that shows you how to use Lite Foundation correctly.

You can grab Lite Foundation for free here: http://cl.ly/3e2872905214e7607d62
Its released under the MIT license which allows to do everything what you want with it.

If you still have questions or if something is a little bit unclear, don't hesitate to ask them, I will answer every question!

Thanks to Hummel, Michael Schwarz and Puppeteer for their tips with the getting started document!


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: Lite Foundation (now with beginner support) [Re: WretchedSid] #343934
10/11/10 23:59
10/11/10 23:59
Joined: Dec 2008
Posts: 271
Saturnus Offline
Member
Saturnus  Offline
Member

Joined: Dec 2008
Posts: 271
Nice!

It leaves the impression of an elaborate and well structured library. The getting started document was a good idea, too.

I didn't have a deeper look into it yet, though. I certainly will just as I need it.

BTW: The issue of having to pass at least one parameter when calling struct methods seems to be fixed in A8. At least the compiler doesn't like _observer->callback(0) etc. and won't do its job anymore. In A7 it compiles fine.

Re: Lite Foundation (now with beginner support) [Re: Saturnus] #344878
10/21/10 14:56
10/21/10 14:56
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline OP
Expert
WretchedSid  Offline OP
Expert

Joined: Apr 2007
Posts: 3,751
Canada
Hey, thanks for the nice feedback.
Yes, A8.03 indeed fixed this bug, previous A8 versions didn't had it. As there is no define that indicates the A8/A7 version, I had to rewrite the callback system to make it work with A8 and A7.

I also did some other minor changes, so I decided to release a new version (btw, thanks to the 24 downloaders, although I wished some more feedback :P).
The new version has the version number 0.4.1:1025 and makes the following changes:
-> The LFTypeRef has now two new members that are used to identify objects as Lite Foundation objects (including their version). The first member just holds the size of the struct (to identify changes) and the second member is the magic number (22574592 >> 8) used to identify an Lite Foundation object
-> Together with the new members comes a new function to check if an object is an Lite Foundation object or not (LFIsType()).
-> This comes to the next great thing: LFArrayRef objects can now also hold non Lite Foundation objects, although they won't get archived and don't retained.
-> Another thing is the LFTypeCopy() function that creates a copy of Lite Foundation objects (when they implement it), you can also adopt this by overwriting the copy member of your LFTypeRef instance (A more detailed guide will follow). The Lite Foundation objects that implement this create deep copies, you may adopt this behavior if you want.
-> When calling LFAutorelease() the objects gets released within the next step of the run loop. So far so known, new is the following: They get released at the beginning of the step, not at the end. This means that when you call LFAutorelease() from within a LFTimerRef or LFRunLoopObserverRef callback, the autorelease objects don't receive a release call until the next step.
-> The already mentioned bug with A8.03 is fixed. LFRunLoopObserverRef and LFTimerRef callbacks now need to have one argument from type LFTypeRef. They receive the pointer to the LFTimerRef or LFRunLoopObserverRef object that called the callback.

Sooo, thats it, like I said, this is just a small update.
Here is the download link: http://cl.ly/b93cf41fe8777a718139

What follows next: I want to extend the current function set and also cleanup everything a bit. The LFBucketRef needs also to be finished (what a damn beast) and I have a few other ideas for objects (anyone interested in an object that provides non blocking IO?). I also want to write two new guides, the first one is a "Memory Management Guideline" (I already started it) and the second one will be a guide on how integrate Lite Foundation into your existing or new application.

Every kind of feedback is really appreciated. Really. I won't eat you!


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: Lite Foundation (now with beginner support) [Re: WretchedSid] #346172
11/02/10 00:34
11/02/10 00:34
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
When running the demo_timer.c file (version: 21.10.2010 14:35), the application runs for about 5 seconds but crashes with the following error message:
"Error E1513: Script crash in createObject: SYS"


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Lite Foundation (now with beginner support) [Re: Superku] #346177
11/02/10 08:02
11/02/10 08:02
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline OP
Expert
WretchedSid  Offline OP
Expert

Joined: Apr 2007
Posts: 3,751
Canada
Thats strange, I can't run it atm but for me it looks perfectly fine.
The demo is supposed to create two timers, one that displays the current time (fires every second) and one that spawns an object (fires every five seconds).
The second function to spawn the object is completely based on top of Gamestudio and does nothing Lite Foundation specific, so I assume that this crash isn't Lite Foundations fault.
But I really can't see anything wrong, maybe someone else can see whats going wrong?
Code:
void createObject(LFTimerRef *timer)
{
	ENTITY *object = ent_create("box.mdl", vector(2048, 0, 0), NULL);
	var force = 32;
	
	while(object.z > -150) 
	{
		object.z += force * time_step;
		force -= (4 * time_step);
		
		wait(1);
	}
	
	set(object, TRANSLUCENT);
	object.alpha = 100;
	
	while(object.alpha > 0)
	{
		object.alpha -= (18 * time_step);
		object.z += force * time_step;
		force -= (4 * time_step);
		
		wait(1);
	}
	
	ent_remove(object);
}


(demo_timer.c line 28)


On a side note: I'm still working on the project, currently I'm rewriting the LFDateRef object that allows you now to have milliseconds (on *nix machines even nanoseconds), this also affects every object that works with dates, eg. the timer that can now fire in a millisecond range.
I have implemented an object that allows you to serialize and deserialize any kind of object, without the problem that the data breaks once you change your objects internal structure. It also don't has problems when you switch your byte order or the size of the objects (eg. when switching between x86 and x86-64).
I'm currently working on an object that allows you to serialize and deserialize a complete list of objects.
Oh, and a unit testing object comes too...


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: Lite Foundation (now with beginner support) [Re: WretchedSid] #346180
11/02/10 10:41
11/02/10 10:41
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
"The demo is supposed to create two timers, one that displays the current time (fires every second) and one that spawns an object (fires every five seconds)."

Yes, I've already seen that. The first timer seems to run fine, but no entity gets created. I've used sys_marker and the error message shows "ABC" now, but I have no idea why it crashes.

Code:
void createObject(LFTimerRef *timer)
{
	sys_marker("ABC");
	ENTITY *object = ent_create("box.mdl", vector(2048, 0, 0), NULL);
	var force = 32;
	sys_marker(NULL);

	while(object.z > -150) 
	{
	...



Btw your Lite Foundation is a very neat contribution, I think I'm gonna use it for my next project. Looks like it was a lot of work, too.
Your file-write command seems to use some kind of encryption or am I'm wrong?
EDIT: The reference with module/ structure list is nice.

Last edited by Superku; 11/02/10 10:46.

"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Lite Foundation (now with beginner support) [Re: Superku] #346185
11/02/10 11:54
11/02/10 11:54
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline OP
Expert
WretchedSid  Offline OP
Expert

Joined: Apr 2007
Posts: 3,751
Canada
I just tried to reproduce the crash on a laptop running Windows 7 with Gamestudio A8.03.2 and the demo didn't crashed.
Maybe someone else can test it too and report if its works or not? This looks a little bit like a Gamestudio related problem and I can't see any reason in my code that could produce the bug.

Quote:

Your file-write command seems to use some kind of encryption or am I'm wrong?

I guess you mean the files produced by LFDataRef objects? If so, no, they aren't encrypted, but the LFDataRef object is meant to store binary data and thus also saves binary data.
If you add a CString to an LFDataRef object and then write it to a file, you will see that it stores the data unencrypted (btw, the LFDataRef and LFStringRef objects are toll-free bridged in the next version)


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: Lite Foundation (now with beginner support) [Re: WretchedSid] #346188
11/02/10 12:20
11/02/10 12:20
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
"[...]Windows 7 with Gamestudio A8.03.2 and the demo didn't crashed."

Hm that's weird. I've tried the code with the current beta (8.04.2b) and with 7.86, same crashes. I'm using Windows XP, if that makes any difference.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Lite Foundation (now with beginner support) [Re: Superku] #346191
11/02/10 13:21
11/02/10 13:21
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline OP
Expert
WretchedSid  Offline OP
Expert

Joined: Apr 2007
Posts: 3,751
Canada
Thats indeed very weird. I would expect such crashes in an multithreaded application, but I guess that you didn't modified the run loop so that it runs in a background thread.

I also don't see a reason why it should crash on Windows XP, I will test it on another machine later this day (A7 and A8, Windows XP), but it would be also awesome if someone else could test it too.


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: Lite Foundation (now with beginner support) [Re: WretchedSid] #346194
11/02/10 13:56
11/02/10 13:56
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
win7 x64 8.03.2 works fine. will test on xp

and also, i just figured how awesome the lite foundation is.

Last edited by Quadraxas; 11/02/10 13:57.

3333333333
Page 1 of 2 1 2

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1