• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
lb2024

Programming for software intermingling(?)

35 posts in this topic

Hello.

 

I'm not necessarily new to programming (in fact I've knew about gamedev for years now), but I'm not the best either.

 

But before going into too much details into me, I am wondering how to make a program open and gather information out of another program and insert data it into another one.

 

To be clear, I work gathering loads of data. I test cable lines and knowing the peak of lines, and distance is important. This data is saved as a ".dat" file and contains important information that is usually repeated throughout the testing process. What I want, is to retrieve certain elements of that file (peak, distance, etc) and create a file that can embed the information into Excel (or excel like workbook).

 

I also want to create a ".txt" file (manually using notepad) and have that imported into Excel (or an excel like workbook).

 

I also want the program to read file names (inside a folder) and check to see if I have all the files needed and if not which ones are missing or which ones are named incorrectly.

 

This is important to me because I'm spending days just compiling different lines but the same information into excel sheets, and if I could just make something that reads the file and insert them automatically that will save me so much time.

 

I don't intend to crack, alter, or do anything malicious to the software I'm reading, but I do want to be able to pull information out and place into another one.

 

I hope you guys can help me so I can save myself the headache of working night and day doing the same monotonous work. Thanks.

 

 

0

Share this post


Link to post
Share on other sites

Well, the first thing you need to know is what the input data format looks like. The second thing is what you want the output data format to look like.

 

If you can specify the details of both of those, it should be pretty straightforward to write code to do the conversion automatically.

0

Share this post


Link to post
Share on other sites

It sounds like you need a script. It depends on the platform, but you can write a bash (on unix) or ar batch (on windows) file and do those things. You can check directories and files and then open or close other applications with the input and output needed.

 

Also, you can do those things with other less frustrating and flexible languages like Perl (Practical Extraction and Report Language), but I'm not sure how easy you can open other apps with that program (basically, you're creating a new process, and that is platform dependant).

 

If you wan't to write lines to an opened Excel file... I have no idea if that's possible.

0

Share this post


Link to post
Share on other sites
I'm not sure how hard PEARL is to learn but will making a script allow me to operate other software and check parameters to make sure its correct before making a pdf and txt for example. And will PEARL allow checking a folder and the data filename one by one and check against a txt file to make sure all is there?

Other options? I appreciate the feedback. In a few days I'll go head first in whatever I need because this data train never stops lol.
0

Share this post


Link to post
Share on other sites

In my opinion... don't bother learning a whole new language just because it might be 5% more efficient. If you already know how to program, just use what you know. Unless you're exclusively writing code for calculators, your language of choice almost certainly can do file I/O and basic data transformations. Use it.

1

Share this post


Link to post
Share on other sites


Unless you're exclusively writing code for calculators, your language of choice almost certainly can do file I/O and basic data transformations. Use it.

My only caveat to that would be that if your language of choice happens to be C, C++ or their close relatives, and the file formats your are working with are text-based, then you may find that various other languages (Python, Perl, etc) are drastically simpler to perform text manipulations in.

 

However, if you are only implementing this once, then as ApochPiQ says, no point learning a whole new language.

1

Share this post


Link to post
Share on other sites

Yeah, fair enough; I just object to the mentality that "oh you want to process data therefore THE ONLY RIGHTEOUS AND HOLY ANSWER IS FOO."

0

Share this post


Link to post
Share on other sites

Yeah, fair enough; I just object to the mentality that "oh you want to process data therefore THE ONLY RIGHTEOUS AND HOLY ANSWER IS FOO."

You clearly don't remember writing CGI scripts in ANSI C ;)

0

Share this post


Link to post
Share on other sites

Oh yes I do :-P

 

That's kinda my point, really; use what is good for the job, but weigh that against what tools you have immediately available.

1

Share this post


Link to post
Share on other sites
Any good sites or resources to find out how to do what I need in c++(this one? )? What exactly is it called what im doing? (Scripts? ) I'm willing to do the leg work but I'm not quite sure the starting points.
0

Share this post


Link to post
Share on other sites
This is what you need:

Well, the first thing you need to know is what the input data format looks like. The second thing is what you want the output data format to look like.
 
If you can specify the details of both of those, it should be pretty straightforward to write code to do the conversion automatically.


Specify what the actual job is, and we can help with implementation.
2

Share this post


Link to post
Share on other sites
What I want is my program to open a file. Once that file is open, I want my program to check the file for: name, limit line, peak value, markers on peak. Once my program verifies that the file is correct it will record those numbers then create a pdf (the software my program will open can do all the above things so my program will just go through checking then using their software to create the pdf)

Now once the file is checked and made into a pdf, if possible, I want this info to populate cells in an excel sheet. This can go on for hundreds to a few thousand times.

Is that enough info? Sorry if my jargon is off.
0

Share this post


Link to post
Share on other sites


What I want is my program to open a file. Once that file is open, I want my program to check the file for: name, limit line, peak value, markers on peak. Once my program verifies that the file is correct...

Can you show us an example of the actual file? There are a million different ways that a name could be stored in a file, and that affects how you read it back out.

0

Share this post


Link to post
Share on other sites
Site id_cable_rl_lb

Basically all the files should have that similar file name. What I plan is creating a txt file for the cross check. So if something is missing my program will notice it and make a file stating whats missing.

I feel the hardest part will be using my program to open the software and go through a script where it will check the parameters I need. If the parameter is off I would like it to change it to the correct parameter. Once everything about the data is correct it will record the info then use the software to create a pdf.

Afterwards it would populate an excel sheet for me.

I know c and c++. I just need to know the libs for strings, and opening other files and reading and manipulating them. Then I believe with a few examples I could whip something up.

Once again thanks guys I really appreciate the feed back.
0

Share this post


Link to post
Share on other sites

I'm more looking for details on the format of the *contents* of the file.

 

Is it text-based? binary? xml? key-value pairs?

0

Share this post


Link to post
Share on other sites
How would I find that out? Its a very basic file of a frequency wave and a few text saved as a ".dat".
0

Share this post


Link to post
Share on other sites

How would I find that out? Its a very basic file of a frequency wave and a few text saved as a ".dat".

 

Open it in a HEX editor?  (or text editor if it's a text based file?) Or consult the file format spec? Swiftcoder is right. Effectively you have a data-structure, albeit one that's been serialized to disk. The structure of your data will, to a large extent, influence how relevant or applicable the advice we give will be. This returns the contents of any file as a string:

 

[source]

std::string loadFile(const char* filename)
{

  std::string p;

  std::FILE* fp = std::fopen(filename, "rb");
  if(fp)

  {
    std::fseek(fp, 0, SEEK_END);
    size_t s = std::ftell(fp);
    if(s)  
    {

      std::fseek(fp, 0, SEEK_SET);

      p.resize(s);
      std::fread(&p[0], 1, s, fp);

    }

    std::fclose(fp);
  }

  return p;
}

[/source]

 

Now, you wouldn't actually want to use that. Probably. Maybe. Possibly. Who the hell knows? Take the gamble? Phone a friend? I don't know, nor does anyone else.

 

To use a car analogy:  The above code gives permission for a passenger to open a car door. Swiftcoder is merely asking what your passengers will find beyond that door. Will they find that the car is stationary? Will they find the ground rushing past them at 70mph? Will they find that the car has actually been compressed, in a vice, and that the doors cannot open?

 

How you tackle problems of this sort are 'usually' formulaic. I'm happy to step onto tarmac that isn't moving, less enthusiastic when it's moving at speed (stop first!), and would like to know whether I should keep my mobile on me, just in case someone tries to squish me in a vice. 

1

Share this post


Link to post
Share on other sites
What would I need to allow my program to open another program and run said script to automatically :check/change value, record it, make pdf...etc?
0

Share this post


Link to post
Share on other sites
I want to do it because of the mundane practice of going through thousands of files checking the same thing over and over and then inputting slightly different values all day. If I can create a program that can do it for me it will free up my time to pursue more worthwhile things maybe even more money for me.
0

Share this post


Link to post
Share on other sites

I want to do it because of the mundane practice of going through thousands of files checking the same thing over and over and then inputting slightly different values all day. If I can create a program that can do it for me it will free up my time to pursue more worthwhile things maybe even more money for me.

Quite a few people are trying to advise you on good ways to accomplish the task you are talking about, but you seem to be very reluctant about showing exactly -what- you are trying to do.

You might as well be saying, "See I have this play, but I don't know if the script is any good, can anyone tell me?" and not posting any of the play.

Personally my force powers are a bit off these days so I have trouble reading things that aren't around to see. Edited by Satharis
0

Share this post


Link to post
Share on other sites
I apologize if I seem vauge. Im not sure what else to say though. In my imagination it seems straightforward. I want to make a program to follow a script of checks and balances to do work for me. A flow chart will be something on the order of:
Open txt file
open folder
check folder contents against txt file
record successful or error
open filename
check measurement
check limit
Record value
create pdf
close file
Insert value into excel

Rinse and repeat


At this point I feel like I just need to start programming away and ask technical questions for portions I am unsure about. I appreciate all the help from you guys. I'll try and whip something up and ask for technical questions from now on.
0

Share this post


Link to post
Share on other sites

Is this meant to run on only Windows, or cross-platform? Windows has decent APIs for manipulating folder contents, whereas cross-platform you'll probably want to use something like boost::filesystem.

0

Share this post


Link to post
Share on other sites

The process is indeed very straightforward, aside from maybe emitting PDF documents and interacting with Excel (although both are totally possible).

 

I'm honestly a little confused about your level of comfort with programming, though. If you're actually comfortable in C or C++, and you can spell out the logic and requirements, you're 90% of the way to a working program. The rest is just making API calls.

 

The only reason I can see you having such trouble envisioning how to do this is if you're not really very practiced with programming. This is fine - we all start someplace - but it would be better to be upfront about it so we know how best to help you.

 

 

I think the reason for all the questions is we're seeing your posts and assuming you don't know how to do the basic parts. If that's true, then you need to actually work with the posters asking questions, by either providing the information they're looking for, or explaining why you can't. On the flip side, if you've got the basics handled and really just need help with something more specific (say, PDF emission), then please say so.

 

As it stands, I don't think anyone really knows how to be useful to you.

1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0