Raised This Month: $51 Target: $400
 12% 

SourceModGen - Data modeling tool


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
API
Veteran Member
Join Date: May 2006
Old 06-09-2013 , 02:49   SourceModGen - Data modeling tool
Reply With Quote #1

Hey guys,

For the past day or so I have been working on the first version of what I like to call SourceModGen

Link: http://smgen.pointlimit.com
Github (source code): https://github.com/AnthonyIacono/SourceModGen

What is it?
SourceModGen is a data visualization tool that will generate redundant code based on structure descriptions. It supports many different types and in the future (once I get some sleep) I will make it generate database CRUD methods as well (Create, Read, Update, Delete)

UPDATE v1.1: SourceModGen now generates KV read / write functions.
UPDATE v1.2: SourceModGen now generates constants (with a configurable prefix) instead of hard-coding block size, field KV keys, and field max lengths.

In short, SourceModGen generates functions that allow you as an SM developer to worry less about the structure and storage of your data and worry more about getting things done.

I haven't had a chance to test it thoroughly, but reading over the generated code looks promising.
__________________

Last edited by API; 04-23-2020 at 10:03.
API is offline
Send a message via AIM to API
030Maric
Member
Join Date: Apr 2012
Location: Berlin
Old 06-09-2013 , 03:35   Re: SourceModGen - Data modeling tool
Reply With Quote #2

WOW

Thanks a lot...
030Maric is offline
API
Veteran Member
Join Date: May 2006
Old 06-09-2013 , 11:21   SourceModGen - Data modeling tool
Reply With Quote #3

I can't wait to add some more stuff to this and release a data modeling video tutorial.
__________________

Last edited by API; 06-09-2013 at 15:33.
API is offline
Send a message via AIM to API
API
Veteran Member
Join Date: May 2006
Old 06-09-2013 , 22:26   Re: SourceModGen - Data modeling tool
Reply With Quote #4

Okay just updated it to generate read / write functions for KeyValues. I've also changed the default variable prefix and function parameter prefix. I'll be doing a video tutorial next on how you can use SMGen to speed up development cycles.
__________________
API is offline
Send a message via AIM to API
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 06-10-2013 , 22:10   Re: SourceModGen - Data modeling tool
Reply With Quote #5

Wtb malloc calloc

realloc*
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.

Last edited by friagram; 06-10-2013 at 22:12.
friagram is offline
API
Veteran Member
Join Date: May 2006
Old 06-10-2013 , 22:34   Re: SourceModGen - Data modeling tool
Reply With Quote #6

Code:
CloseHandle()
__________________
API is offline
Send a message via AIM to API
API
Veteran Member
Join Date: May 2006
Old 06-10-2013 , 22:37   Re: SourceModGen - Data modeling tool
Reply With Quote #7

Unless I'm misunderstanding your not-sentence.
__________________
API is offline
Send a message via AIM to API
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 06-11-2013 , 08:34   Re: SourceModGen - Data modeling tool
Reply With Quote #8

No, i am just pointing out how odd and inefficient dynamic array models are in pawn.
But sure, you don't need these type functions, esp realloc, you can just allocate a new array of the new size, copy the contents, and close the old handle, and return the new handle. You need more functions to do it.

Also, there is no tag type associated to the array, i think, so you can't initialize it on creation. This is a bit annoying.

Presumably array creation will succeed? There is no way of knowing i think, because it doesn't return something like null ptr on failure.
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram is offline
API
Veteran Member
Join Date: May 2006
Old 06-11-2013 , 10:20   Re: SourceModGen - Data modeling tool
Reply With Quote #9

SMGen creates a copy function.

Example:
Code:
stock Handle:War3_CopyWar3Race(Handle:p_War3Race) {
    new Handle:s_War3Race = CreateArray(8);

    PushArrayCell(s_War3Race, GetArrayCell(p_War3Race, 0));
    decl String:s_ShortNameOutput[32];
    GetArrayString(p_War3Race, 1, s_ShortNameOutput, 32);
    PushArrayString(s_War3Race, s_ShortNameOutput);
    decl any:s_DescriptionOutput[5];
    GetArrayArray(p_War3Race, 2, s_DescriptionOutput, 5);
    PushArrayArray(s_War3Race, s_DescriptionOutput, 5);

    return s_War3Race;
}
__________________
API is offline
Send a message via AIM to API
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 06-11-2013 , 16:49   Re: SourceModGen - Data modeling tool
Reply With Quote #10

Quote:
Originally Posted by friagram View Post
No, i am just pointing out how odd and inefficient dynamic array models are in pawn.
But sure, you don't need these type functions, esp realloc, you can just allocate a new array of the new size, copy the contents, and close the old handle, and return the new handle. You need more functions to do it.
I'm lost as to what you mean here. adt_arrays automatically resize based on how many elements they have so you should never have to copy data between adt_arrays... and since normal Pawn arrays don't use handles, I have to assume you're talking about adt_arrays.

Quote:
Originally Posted by friagram View Post
Also, there is no tag type associated to the array, i think, so you can't initialize it on creation. This is a bit annoying.
Yes, but sadly it's more or less a limitation of Pawn. Remember, everything is a 32-bit int to Pawn, even floating point numbers. Strings are just sets of 4 chars stuffed into 32-bit ints.

Quote:
Originally Posted by friagram View Post
Presumably array creation will succeed? There is no way of knowing i think, because it doesn't return something like null ptr on failure.
It returns INVALID_HANDLE on failure.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:16.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode